From: John Hodge Date: Mon, 18 Jul 2011 13:39:38 +0000 (+0800) Subject: Kernel - Added an errno macro (implemented with TLS) X-Git-Tag: rel0.10~33 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=1544491b3b1a854e2c8333ca75d6b20a5550e03f;p=tpg%2Facess2.git Kernel - Added an errno macro (implemented with TLS) --- diff --git a/Kernel/include/acess.h b/Kernel/include/acess.h index 707ad7f3..ad865784 100644 --- a/Kernel/include/acess.h +++ b/Kernel/include/acess.h @@ -39,7 +39,7 @@ typedef struct sShortSpinlock tShortSpinlock; */ /** - * \name Per-Process Configuration Settings + * \name Per-Thread Configuration Settings * \{ */ enum eConfigTypes { @@ -52,10 +52,13 @@ enum eConfigs { CFG_VFS_CWD, CFG_VFS_MAXFILES, CFG_VFS_CHROOT, + CFG_ERRNO, NUM_CFG_ENTRIES }; #define CFGINT(id) (*Threads_GetCfgPtr(id)) #define CFGPTR(id) (*(void**)Threads_GetCfgPtr(id)) + +#define errno (CFGINT(CFG_ERRNO)) /** * \} */ diff --git a/Kernel/vfs/mmap.c b/Kernel/vfs/mmap.c index 98137d44..7c3fdf4b 100644 --- a/Kernel/vfs/mmap.c +++ b/Kernel/vfs/mmap.c @@ -21,7 +21,7 @@ struct sVFS_MMapPageBlock }; // === CODE === -void *VFS_MMap(int *ErrNo, void *DestHint, size_t Length, int Protection, int Flags, int FD, Uint64 Offset) +void *VFS_MMap(void *DestHint, size_t Length, int Protection, int Flags, int FD, Uint64 Offset) { tVFS_Handle *h; tVAddr mapping_dest; @@ -115,7 +115,7 @@ void *VFS_MMap(int *ErrNo, void *DestHint, size_t Length, int Protection, int Fl return NULL; } -int VFS_MUnmap(int *ErrNo, void *Addr, size_t Length) +int VFS_MUnmap(void *Addr, size_t Length) { return 0; }