From 6938b8d4b026cb720f713117d2957dcd9bcf010a Mon Sep 17 00:00:00 2001 From: jmcmullan Date: Mon, 20 Aug 2012 03:19:02 +0000 Subject: [PATCH] partition.library: Conversion to rellib Signed-off-by: Jason S. McMullan git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@45616 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- rom/partition/mmakefile.src | 3 +-- rom/partition/partition.conf | 10 +++++++++- rom/partition/partition_init.c | 8 -------- rom/partition/partition_intern.h | 16 +++++----------- 4 files changed, 15 insertions(+), 22 deletions(-) diff --git a/rom/partition/mmakefile.src b/rom/partition/mmakefile.src index 89711485b7..e3919b2494 100644 --- a/rom/partition/mmakefile.src +++ b/rom/partition/mmakefile.src @@ -42,8 +42,7 @@ FUNCS := \ #MM kernel-partition-kobj : core-linklibs core-linklibs #MM- core-linklibs: linklibs-partition -USER_CFLAGS := -DDEBUG=0 \ - -D__UTILITY_NOLIBBASE__ +USER_CFLAGS := -DDEBUG=0 USER_LDFLAGS := -L$(GENDIR)/lib %build_module mmake=kernel-partition \ diff --git a/rom/partition/partition.conf b/rom/partition/partition.conf index 4147b8b6d4..0293271b1a 100644 --- a/rom/partition/partition.conf +++ b/rom/partition/partition.conf @@ -6,7 +6,10 @@ libbasetypeextern struct PartitionBase seglist_field segList version 3.1 residentpri 40 +rellib utility ##end config + + ##begin cdef #include @@ -19,12 +22,17 @@ residentpri 40 #define WritePartitionData(StartBlock, DataSize, Buffer, Partition) \ WritePartitionDataQ(DataSize, Buffer, Partition, StartBlock) +##end cdef -##end cdef ##begin cdefprivate #include "partition_intern.h" + +#define __aros_getbase() (PartitionBase) +#define __aros_setbase(lh) ((PartitionBase=(lh)),TRUE) ##end cdefprivate + + ##begin functionlist struct PartitionHandle *OpenRootPartition(CONST_STRPTR Device, LONG Unit) (A1, D1) void CloseRootPartition(struct PartitionHandle *ph) (A1) diff --git a/rom/partition/partition_init.c b/rom/partition/partition_init.c index 1614c9bd1f..7f1fbdb23e 100644 --- a/rom/partition/partition_init.c +++ b/rom/partition/partition_init.c @@ -16,10 +16,6 @@ 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); InitSemaphore(&LIBBASE->bootSem); @@ -43,10 +39,6 @@ static int PartitionCleanup(struct PartitionBase_intern *base) if (base->pb_DOSBase) CloseLibrary(base->pb_DOSBase); - /* REMOVE ONCE ABIv1 HAS STABILIZED */ - if (base->pb_UtilityBase) - CloseLibrary(base->pb_UtilityBase); - return TRUE; } diff --git a/rom/partition/partition_intern.h b/rom/partition/partition_intern.h index 0b5c11e462..c64871bd89 100644 --- a/rom/partition/partition_intern.h +++ b/rom/partition/partition_intern.h @@ -22,22 +22,16 @@ struct PartitionBase_intern BPTR segList; struct List bootList; struct SignalSemaphore bootSem; - struct Library *pb_DOSBase; - /* REMOVE ONCE ABIv1 HAS STABALIZED */ - struct Library *pb_UtilityBase; + /* We do NOT autoinit DOSBase, because we want to be + * explicit about all uses of DOSBase, since it may + * be NULL (and that's ok!). + */ + struct Library *pb_DOSBase; }; #define PBASE(x) ((struct PartitionBase_intern *)x) #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 */ -- 2.11.4.GIT