X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Finclude%2Facess.h;h=83611bb6851b31fc2d9aaa9e29f88d75d98e378d;hb=85362e8a4c919b58cd261345d29f26bae4ad75e2;hp=8a413a2790b6b71e95d3d8bb683e22f3bcf40c29;hpb=e2744a459d1c63435d7348d0bfd0e4b92b0ec9f9;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/include/acess.h b/KernelLand/Kernel/include/acess.h index 8a413a27..83611bb6 100644 --- a/KernelLand/Kernel/include/acess.h +++ b/KernelLand/Kernel/include/acess.h @@ -10,6 +10,7 @@ */ #include +#include #include #ifndef HALT_CPU @@ -26,7 +27,7 @@ #define DEPRECATED __attribute__((deprecated)) //! Mark a parameter as unused #define UNUSED(x) UNUSED_##x __attribute__((unused)) -//! +//! Apply alignment to a variable #define ALIGN(x) __attribute__((aligned(x))) /** @@ -51,7 +52,6 @@ typedef Uint32 tGID; //!< Group ID Type typedef Sint64 tTimestamp; //!< Timestamp (miliseconds since 00:00 1 Jan 1970) typedef Sint64 tTime; //!< Same again typedef struct sShortSpinlock tShortSpinlock; //!< Opaque (kinda) spinlock -typedef int bool; //!< Boolean type typedef Uint64 off_t; //!< VFS Offset typedef struct { char _[PAGE_SIZE];} tPage; // Representation of a page for pointer arithmatic @@ -85,11 +85,11 @@ extern const char gsBuildInfo[]; * \{ * \todo Move to mm_virt.h */ -#define MM_PFLAG_RO 0x01 // Writes disallowed -#define MM_PFLAG_EXEC 0x02 // Allow execution -#define MM_PFLAG_NOPAGE 0x04 // Prevent from being paged out -#define MM_PFLAG_COW 0x08 // Copy-On-Write -#define MM_PFLAG_KERNEL 0x10 // Kernel-Only (Ring0) +#define MM_PFLAG_RO 0x01 //!< Writes disallowed +#define MM_PFLAG_EXEC 0x02 //!< Allow execution +#define MM_PFLAG_NOPAGE 0x04 //!< Prevent from being paged out +#define MM_PFLAG_COW 0x08 //!< Copy-On-Write +#define MM_PFLAG_KERNEL 0x10 //!< Kernel-Only (Ring0) /** * \} */ @@ -143,7 +143,9 @@ typedef struct sKernelSymbol { * \name IRQ hander registration * \{ */ +//! Register a callback for when an IRQ is raised extern int IRQ_AddHandler(int Num, void (*Callback)(int, void*), void *Ptr); +//! Remove a previously registered IRQ handler extern void IRQ_RemHandler(int Handle); /** * \} @@ -240,6 +242,15 @@ extern Uint MM_GetFlags(volatile const void *VAddr); * \note There is only a limited ammount of slots avaliable */ extern void *MM_MapTemp(tPAddr PAddr); +/** + * \brief Peform a temporary map of a page from another process + * \param Process Source process + * \param Address Source virtual address + * \return Virtual address of page in memory + * \note Limited slots + */ +struct sProcess; +extern void *MM_MapTempFromProc(struct sProcess *Process, const void *Address); /** * \brief Free a temporarily mapped page * \param Ptr Pointer to page base