From: John Hodge Date: Sat, 27 Jul 2013 15:50:55 +0000 (+0800) Subject: Tools/nativelib - Updated to handle recent(ish) kernel changes X-Git-Tag: rel0.15~311 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=071e393d22b502d75fa1a9292623cb9356c558d8;p=tpg%2Facess2.git Tools/nativelib - Updated to handle recent(ish) kernel changes --- diff --git a/Tools/nativelib/Makefile b/Tools/nativelib/Makefile index 6b1957ed..7b78667f 100644 --- a/Tools/nativelib/Makefile +++ b/Tools/nativelib/Makefile @@ -3,7 +3,7 @@ KERNEL_DIR := ../../KernelLand/Kernel NOBJ := logging.o misc.o threads_int.o -LOBJ := threads.o time.o +LOBJ := threads.o time.o dummy_iocache.o # mutex.o rwlock.o semaphore.o KOBJ += vfs/main.o vfs/open.o vfs/acls.o vfs/io.o vfs/dir.o @@ -11,6 +11,7 @@ KOBJ += vfs/nodecache.o vfs/mount.o vfs/memfile.o # vfs/select.o KOBJ += vfs/fs/root.o vfs/fs/devfs.o KOBJ += drv/proc.o KOBJ += mutex.o rwlock.o semaphore.o +KOBJ += utf16.o NOBJ := $(NOBJ:%.o=obj/%.o) LOBJ := $(LOBJ:%.o=obj/%.o) diff --git a/Tools/nativelib/dummy_iocache.c b/Tools/nativelib/dummy_iocache.c new file mode 100644 index 00000000..b0898fe3 --- /dev/null +++ b/Tools/nativelib/dummy_iocache.c @@ -0,0 +1,48 @@ +/* + * Acess2 Kernel + * - By thePowersGang (John Hodge) + * + * dummy_iocache.c + * - Dummied-out Block IO Caching + */ +#define DEBUG 0 +#include +#include + +struct sIOCache +{ + tIOCache_WriteCallback Write; + void *ID; +}; + +// === CODE === +tIOCache *IOCache_Create( tIOCache_WriteCallback Write, void *ID, int SectorSize, int CacheSize ) +{ + tIOCache *ret = malloc(sizeof(tIOCache)); + ret->Write = Write; + ret->ID = ID; + return ret; +} +int IOCache_Read( tIOCache *Cache, Uint64 Sector, void *Buffer ) +{ + return 0; +} +int IOCache_Add( tIOCache *Cache, Uint64 Sector, const void *Buffer ) +{ + return 1; +} +int IOCache_Write( tIOCache *Cache, Uint64 Sector, const void *Buffer ) +{ + #ifndef DISABLE_WRITE + Cache->Write(Cache->ID, Sector, Buffer); + #endif + return 1; +} +void IOCache_Flush( tIOCache *Cache ) +{ +} +void IOCache_Destroy( tIOCache *Cache ) +{ + free(Cache); +} + diff --git a/Tools/nativelib/logging.c b/Tools/nativelib/logging.c index c2d8a76a..16e6f70e 100644 --- a/Tools/nativelib/logging.c +++ b/Tools/nativelib/logging.c @@ -53,6 +53,11 @@ void Log_Log(const char *Ident, const char *Message, ...) void Log_Debug(const char *Ident, const char *Message, ...) PUTERR("37", "d") +void Panic(const char *Message, ...) { + const char *Ident = ""; + PUTERR("35", "k") + exit(-1); +} void Warning(const char *Message, ...) { const char *Ident = ""; PUTERR("33", "W")