mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Add initial PCIe enumeration
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user