1
0
mirror of https://github.com/deadw00d/AROS.git synced 2026-03-17 17:09:26 +00:00

store and use the genmodule provided sysbase, so no symbols are pulled in.

This commit is contained in:
Kalamatee
2025-10-25 19:38:55 +01:00
committed by deadwood
parent 0d872267a3
commit f996d0601e
7 changed files with 36 additions and 22 deletions

View File

@ -3,7 +3,6 @@
*/
#include <proto/exec.h>
#define __NOLIBBASE__
#include <proto/log.h>
#include <aros/libcall.h>
@ -19,7 +18,6 @@
#define DOSBase LIBBASE->lrb_DosBase
#define TimerBase LIBBASE->lrb_TimerIOReq.tr_node.io_Device
/*****************************************************************************************
NAME
@ -71,6 +69,7 @@
BOOL GM_UNIQUENAME(HaveTimer)(LIBBASETYPEPTR LIBBASE)
{
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
if (TimerBase)
return TRUE;
if (LIBBASE->lrb_sigTryTimer != -1)
@ -83,6 +82,7 @@ BOOL GM_UNIQUENAME(OpenTimer)(LIBBASETYPEPTR LIBBASE)
if (TimerBase)
return TRUE;
else {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
LIBBASE->lrb_TimerIOReq.tr_node.io_Message.mn_Node.ln_Type = NT_REPLYMSG;
LIBBASE->lrb_TimerIOReq.tr_node.io_Message.mn_Length = sizeof(struct timerequest);
LIBBASE->lrb_TimerIOReq.tr_node.io_Message.mn_ReplyPort = NULL;
@ -99,8 +99,10 @@ BOOL GM_UNIQUENAME(HaveDOS)(LIBBASETYPEPTR LIBBASE)
{
if (DOSBase)
return TRUE;
if (LIBBASE->lrb_sigTryDOS != -1)
if (LIBBASE->lrb_sigTryDOS != -1) {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
Signal((struct Task *)LIBBASE->lrb_ServicePort->mp_SigTask, (1 << LIBBASE->lrb_sigTryDOS));
}
return FALSE;
}
@ -109,6 +111,7 @@ BOOL GM_UNIQUENAME(OpenDOS)(LIBBASETYPEPTR LIBBASE)
if (DOSBase)
return TRUE;
else {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
if ((DOSBase = OpenLibrary("dos.library", 39)))
return TRUE;
}
@ -119,8 +122,11 @@ BOOL GM_UNIQUENAME(OpenUtility)(LIBBASETYPEPTR LIBBASE)
{
if (LIBBASE->lrb_UtilityBase)
return TRUE;
else if ((LIBBASE->lrb_UtilityBase = (struct UtilityBase *)OpenLibrary("utility.library", 39)))
return TRUE;
else {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
if ((LIBBASE->lrb_UtilityBase = (struct UtilityBase *)OpenLibrary("utility.library", 39)))
return TRUE;
}
return FALSE;
}
@ -135,6 +141,7 @@ AROS_LH1(APTR, logInitialise,
APTR logPool;
if (LIBBASE->lrb_Task) {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
if((logProvider) && (logPool = CreatePool(MEMF_CLEAR|MEMF_PUBLIC, 16384, 1024))) {
struct LogResHandle *lpHandle = AllocVecPooled(logPool, sizeof(struct LogResHandle));
lpHandle->lrh_Node.ln_Type = NT_PROVIDER;
@ -182,6 +189,7 @@ static AROS_INTH1(log_LowMemHandler, LIBBASETYPEPTR, LIBBASE)
static void log_Task(LIBBASETYPEPTR LIBBASE)
{
if (!LIBBASE->lrb_Task) {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
struct Task *thisTask = FindTask(NULL);
struct logEntryPrivate *lastBroadcast = NULL;
@ -272,6 +280,7 @@ static void log_Task(LIBBASETYPEPTR LIBBASE)
/* LibInit */
static int GM_UNIQUENAME(libInit)(LIBBASETYPEPTR LIBBASE)
{
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
LIBBASE->lrb_LRProvider.lrh_Node.ln_Name = LIBBASE->lrb_Lib.lib_Node.ln_Name;
NewList(&LIBBASE->lrb_LRProvider.lrh_Entries);
NewList(&LIBBASE->lrb_Providers);

View File

@ -1,8 +1,9 @@
##begin config
version 45.24
version 45.25
libbase LogResBase
libbasetype struct LogResBase
libbasetypeextern struct Library
sysbase_field lrb_ExecBase
residentpri 100
basename log
copyright Copyright 2023-2025 The AROS Dev Team

View File

@ -3,7 +3,6 @@
*/
#include <proto/exec.h>
#define __NOLIBBASE__
#include <proto/kernel.h>
#include <proto/dos.h>
#include <proto/utility.h>
@ -39,6 +38,7 @@ AROS_LH1(VOID, logLockEntries,
LIBBASETYPEPTR, LIBBASE, 13, log)
{
AROS_LIBFUNC_INIT
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
ObtainSemaphore(&LIBBASE->lrb_ReentrantLock);
AROS_LIBFUNC_EXIT
}
@ -48,6 +48,7 @@ AROS_LH1(VOID, logUnlockEntries,
LIBBASETYPEPTR, LIBBASE, 15, log)
{
AROS_LIBFUNC_INIT
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
ReleaseSemaphore(&LIBBASE->lrb_ReentrantLock);
AROS_LIBFUNC_EXIT
}
@ -212,6 +213,7 @@ AROS_LH2(IPTR, logGetEntryAttrs,
struct LogResHandle *lrHandle = (struct LogResHandle *)loghandle;
if ((LIBBASE->lrb_Task) && (lrHandle)) {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
struct logEntryPrivate *leP;
if ((leP = AllocVecPooled(lrHandle->lrh_Pool, sizeof(struct logEntryPrivate)))) {
memset(leP, 0, sizeof(struct logEntryPrivate));
@ -280,6 +282,7 @@ AROS_LH1(void, logRemEntry,
AROS_LIBFUNC_INIT
if (le) {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
struct logEntryPrivate *leP;
leP = (struct logEntryPrivate *)((IPTR)le - offsetof(struct logEntryPrivate, le_Node));

View File

@ -69,6 +69,7 @@ struct LogResBase
{
struct Library lrb_Lib;
APTR lrb_KernelBase;
struct ExecBase *lrb_ExecBase;
struct UtilityBase *lrb_UtilityBase; /* for tags etc */
struct Library *lrb_DosBase; /* for dos stuff */

View File

@ -3,7 +3,6 @@
*/
#include <proto/exec.h>
#define __NOLIBBASE__
#include <proto/log.h>
#include <aros/libcall.h>
@ -38,6 +37,7 @@ AROS_LH2(struct logListenerHook *, logAddListener,
if(mp)
{
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
if((llh = AllocVecPooled(LIBBASE->lrb_LRProvider.lrh_Pool, sizeof(struct logListenerHook))))
{
llh->llh_Node.ln_Type = NT_LISTENER;
@ -64,6 +64,7 @@ AROS_LH1(VOID, logRemListener,
{
AROS_LIBFUNC_INIT
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
struct logListenerHook *llh = (struct logListenerHook *)listener;
ObtainSemaphore(&LIBBASE->lrb_ListenerLock);
Remove(&llh->llh_Node);
@ -82,6 +83,7 @@ AROS_LH3(VOID, logEventBroadcast,
{
AROS_LIBFUNC_INIT
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
struct logListenerHook *llh;
struct logEntryPrivate *leP = (struct logEntryPrivate *)((IPTR)param1 - offsetof(struct logEntryPrivate, le_Node));
ULONG msgMatch = (leP->lectx_Level & LOGM_Flag_TypeMask) | (1L << ehmt);
@ -111,6 +113,7 @@ AROS_LH2(void, logDeleteBroadcast,
{
AROS_LIBFUNC_INIT
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
struct logListenerHook *llh = (struct logListenerHook *)listener;
FreeVecPooled(llh->llh_Pool, bMsg);

View File

@ -3,7 +3,6 @@
*/
#include <proto/exec.h>
#define __NOLIBBASE__
#include <proto/dos.h>
#include <proto/utility.h>
#include <proto/timer.h>
@ -33,8 +32,7 @@ AROS_UFH2(void, GM_UNIQUENAME(PutChar),
{
AROS_USERFUNC_INIT
if(rdf->rdf_Len)
{
if(rdf->rdf_Len) {
rdf->rdf_Len--;
*rdf->rdf_Buf++ = ch;
}
@ -65,8 +63,8 @@ AROS_LH4(void, logRawDoFmtA,
struct logRDF rdf;
if(buf && fmtstr && (len > 0))
{
if(buf && fmtstr && (len > 0)) {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
rdf.rdf_Len = len;
rdf.rdf_Buf = buf;
RawDoFmt(fmtstr, fmtdata, (VOID_FUNC) GM_UNIQUENAME(PutChar), &rdf);
@ -87,8 +85,8 @@ AROS_LH6(void, logRawDoFmtCBA,
{
AROS_LIBFUNC_INIT
if(buf && fmtstr && (len > 0))
{
if(buf && fmtstr && (len > 0)) {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
RawDoFmt(fmtstr, fmtdata, cbfunc, cbdata);
buf[len-1] = 0;
}
@ -104,8 +102,8 @@ AROS_LH1(STRPTR, logCopyStr,
STRPTR rs = NULL;
if (name)
{
if (name) {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
rs = AllocVec((ULONG) strlen(name) + 1, MEMF_ANY);
if(rs)
strcpy(rs, name);
@ -124,14 +122,13 @@ AROS_LH2(STRPTR, logCopyStrFmtA,
STRPTR buf = NULL;
if (fmtstr)
{
if (fmtstr) {
struct ExecBase *SysBase = GM_SYSBASE_FIELD(LIBBASE);
ULONG len = 0;
RawDoFmt(fmtstr, fmtdata, (VOID_FUNC) GM_UNIQUENAME(CountChars), &len);
buf = AllocVec(len + 1, MEMF_ANY);
if(buf)
{
if(buf) {
logRawDoFmtA(buf, len+1, fmtstr, fmtdata);
}
}

View File

@ -4,7 +4,7 @@ include $(SRCDIR)/config/aros.cfg
FILES := log log_event log_str log_listener
FUNCS := \
USER_CPPFLAGS := -DMUIMASTER_YES_INLINE_STDARG
USER_CPPFLAGS := -D__NOLIBBASE__
#USER_CPPFLAGS += -DDEBUG=1
#MM- kernel-log : linklibs