From 37c37b235a5ca7411bbb87ddb0f03468a6c4d7be Mon Sep 17 00:00:00 2001 From: jmcmullan Date: Mon, 9 May 2011 19:38:32 +0000 Subject: [PATCH] partition.library: Move .bss data into the Library base. Signed-off-by: Jason S. McMullan git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@38624 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- rom/partition/addbootfilesystem.c | 2 +- rom/partition/fsloader.c | 8 ++++---- rom/partition/mmakefile.src | 1 + rom/partition/partition_init.c | 13 ++++++++++--- rom/partition/partition_intern.h | 13 ++++++++++++- rom/partition/partitionrdb.c | 4 ++-- 6 files changed, 30 insertions(+), 11 deletions(-) diff --git a/rom/partition/addbootfilesystem.c b/rom/partition/addbootfilesystem.c index e014dcbe2b..7dd6cde96a 100644 --- a/rom/partition/addbootfilesystem.c +++ b/rom/partition/addbootfilesystem.c @@ -55,7 +55,7 @@ AROS_LIBFUNC_INIT /* If dos.library is available, load the filesystem immediately */ - if (((struct PartitionBase_intern *)PartitionBase)->dosBase) + if (((struct PartitionBase_intern *)PartitionBase)->pb_DOSBase) return AddFS(PartitionBase, (struct FileSysHandle *)handle); /* Otherwise we need to queue it to the FSLoader hook (if not already done) */ diff --git a/rom/partition/fsloader.c b/rom/partition/fsloader.c index fb80fc37db..b881c813fc 100644 --- a/rom/partition/fsloader.c +++ b/rom/partition/fsloader.c @@ -60,10 +60,10 @@ AROS_UFH3(static APTR, FSLoader_Init, return NULL; /* We should really have dos.library online now */ - PartitionBase->dosBase = OpenLibrary("dos.library", 36); - D(bug("[FSLoader] DOSBase 0x%p\n", PartitionBase->dosBase)); + PartitionBase->pb_DOSBase = OpenLibrary("dos.library", 36); + D(bug("[FSLoader] DOSBase 0x%p\n", PartitionBase->pb_DOSBase)); - if (PartitionBase->dosBase) + if (PartitionBase->pb_DOSBase) { ForeachNodeSafe(&PartitionBase->bootList, bfs, bfs2) { @@ -103,7 +103,7 @@ static struct FileSysEntry *FindResidentFS(struct FileSysResource *fsr, ULONG do ULONG AddFS(struct Library *PartitionBase, struct FileSysHandle *fs) { - struct DosLibrary *DOSBase = (struct DosLibrary *)((struct PartitionBase_intern *)PartitionBase)->dosBase; + struct DosLibrary *DOSBase = (struct DosLibrary *)((struct PartitionBase_intern *)PartitionBase)->pb_DOSBase; struct FileSysResource *fsr; struct FileSysEntry *fsrnode; ULONG dostype; diff --git a/rom/partition/mmakefile.src b/rom/partition/mmakefile.src index 9d880468c1..962e6b1420 100644 --- a/rom/partition/mmakefile.src +++ b/rom/partition/mmakefile.src @@ -38,6 +38,7 @@ FUNCS := \ #MM kernel-partition-kobj : linklibs-core core-linklibs USER_CFLAGS := -DDEBUG=0 \ + -D__UTILITY_NOLIBBASE__ \ $(PARANOIA_CFLAGS) %build_module mmake=kernel-partition \ diff --git a/rom/partition/partition_init.c b/rom/partition/partition_init.c index 5339585ea4..929f575956 100644 --- a/rom/partition/partition_init.c +++ b/rom/partition/partition_init.c @@ -16,6 +16,10 @@ static int PartitionInit(LIBBASETYPEPTR LIBBASE) { + /* REMOVE ONCE ABIv1 HAS STABILIZED */ + if (!(LIBBASE->pb_UtilityBase = TaggedOpenLibrary(TAGGEDOPEN_UTILITY))) + return FALSE; + LIBBASE->partbase.tables = (struct PartitionTableInfo **)PartitionSupport; NewList(&LIBBASE->bootList); @@ -24,7 +28,7 @@ static int PartitionInit(LIBBASETYPEPTR LIBBASE) * It fill fail if we are in kickstart, partition.library is initialized * long before dos.library. */ - LIBBASE->dosBase = OpenLibrary("dos.library", 36); + LIBBASE->pb_DOSBase = OpenLibrary("dos.library", 36); return TRUE; } @@ -42,8 +46,11 @@ static int PartitionCleanup(struct PartitionBase_intern *base) if (!IsListEmpty(&base->bootList)) return FALSE; - if (base->dosBase) - CloseLibrary(base->dosBase); + if (base->pb_DOSBase) + CloseLibrary(base->pb_DOSBase); + + /* REMOVE ONCE ABIv1 HAS STABILIZED */ + CloseLibrary(base->pb_UtilityBase); return TRUE; } diff --git a/rom/partition/partition_intern.h b/rom/partition/partition_intern.h index a556850694..2f791d1e59 100644 --- a/rom/partition/partition_intern.h +++ b/rom/partition/partition_intern.h @@ -20,9 +20,20 @@ struct PartitionBase_intern struct PartitionBase partbase; BPTR segList; struct List bootList; - struct Library *dosBase; + struct Library *pb_DOSBase; + + /* REMOVE ONCE ABIv1 HAS STABALIZED */ + struct Library *pb_UtilityBase; }; #define PTYPE(x) ((struct PartitionType *)x) +/* We do NOT define DOSBase, because we want to be + * explicit about all uses of DOSBase, since it may + * be NULL. + */ + +/* REMOVE ONCE ABIv1 HAS STABALIZED */ +#define UtilityBase (((struct PartitionBase_intern *)PartitionBase)->pb_UtilityBase) + #endif /* PARTITION_INTERN_H */ diff --git a/rom/partition/partitionrdb.c b/rom/partition/partitionrdb.c index 6d645d8ad4..ac49b5ad34 100644 --- a/rom/partition/partitionrdb.c +++ b/rom/partition/partitionrdb.c @@ -1046,8 +1046,8 @@ struct Node *PartitionRDBFindFileSystem(struct Library *PartitionBase, struct Pa BPTR PartitionRDBLoadFileSystem(struct PartitionBase_intern *PartitionBase, struct FileSysHandle *fn) { - if (PartitionBase->dosBase) - return LoadFS((struct FileSysNode *)fn, (struct DosLibrary *)PartitionBase->dosBase); + if (PartitionBase->pb_DOSBase) + return LoadFS((struct FileSysNode *)fn, (struct DosLibrary *)PartitionBase->pb_DOSBase); else return BNULL; } -- 2.11.4.GIT