Add initial PCIe enumeration

This commit is contained in:
Justin C. Miller
2018-05-06 01:38:19 -07:00
parent 20edb87505
commit f64efad057
4 changed files with 132 additions and 4 deletions

View File

@@ -6,12 +6,19 @@
inline void * operator new (size_t, void *p) throw() { return p; }
using addr_t = uint64_t;
namespace kutil {
void * memset(void *p, uint8_t v, size_t n);
template <typename T>
T read_from(const void *p) { return *reinterpret_cast<const T *>(p); }
inline T read_from(const void *p) { return *reinterpret_cast<const T *>(p); }
template <typename T>
inline T * offset_pointer(T *p, size_t offset)
{
return reinterpret_cast<T *>(reinterpret_cast<addr_t>(p) + offset);
}
} // namespace kutil