X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Fcommon.h;h=398724da75b57d369958e95c03a5a62307412fa8;hb=391af300bd045791b8aaf50cf44b2d503c763213;hp=16d089d23e3c2e24f7571570e02d4a72f0e6f7e4;hpb=b6c3b3cf61caafbd91bbf3acc81995e472656a5b;p=tpg%2Facess2.git diff --git a/Kernel/include/common.h b/Kernel/include/common.h index 16d089d2..398724da 100644 --- a/Kernel/include/common.h +++ b/Kernel/include/common.h @@ -74,9 +74,10 @@ extern Uint32 ind(Uint16 Port); extern Uint64 inq(Uint16 Port); // --- Memory --- extern tPAddr MM_Allocate(Uint VAddr); -extern void MM_Deallocate(Uint VAddr); -extern int MM_Map(Uint VAddr, tPAddr PAddr); -extern tPAddr MM_GetPhysAddr(Uint VAddr); +extern void MM_Deallocate(Uint VAddr); //!< Deallocate a page +extern int MM_Map(Uint VAddr, tPAddr PAddr); //!< Map a page +extern tPAddr MM_GetPhysAddr(Uint VAddr); //!< Get the physical address of a page +extern int MM_IsUser(Uint VAddr, int Length); //!< Checks if a memory address is valid user memory extern void MM_SetFlags(Uint VAddr, Uint Flags, Uint Mask); extern Uint MM_MapTemp(tPAddr PAddr); extern void MM_FreeTemp(Uint PAddr); @@ -90,6 +91,10 @@ extern void *memcpy(void *dest, const void *src, Uint count); extern void *memcpyd(void *dest, const void *src, Uint count); extern void *memset(void *dest, int val, Uint count); extern void *memsetd(void *dest, Uint val, Uint count); +extern Uint16 LittleEndian16(Uint16 Val); +extern Uint16 BigEndian16(Uint16 Val); +extern Uint32 LittleEndian32(Uint32 Val); +extern Uint32 BigEndian32(Uint32 Val); // --- Strings --- extern Uint strlen(const char *Str); extern char *strcpy(char *__dest, const char *__src); @@ -105,6 +110,7 @@ extern int WriteUTF8(Uint8 *str, Uint32 Val); extern Uint rand(); // --- Heap --- extern void *malloc(size_t size); +extern void *calloc(size_t num, size_t size); extern void *realloc(void *ptr, size_t size); extern void free(void *Ptr); extern int IsHeap(void *Ptr);