diff --git a/src/system/libroot/os/arch/m68k/syscalls.inc b/src/system/libroot/os/arch/m68k/syscalls.inc index 5af91bd307..7538b2b249 100644 --- a/src/system/libroot/os/arch/m68k/syscalls.inc +++ b/src/system/libroot/os/arch/m68k/syscalls.inc @@ -2,73 +2,75 @@ ** Copyright 2002, Travis Geiselbrecht. All rights reserved. ** Distributed under the terms of the NewOS License. */ -#warning make sure $ isn't hex -#define FUNC(name) .align 2 ; .globl _##name ; .type _##name,@function ; _##name: +#define FUNC(name) .align 2 ; .globl name ; .type name,@function ; name: + +/* lure the preprocessor to not substitute the syscall as string */ +#define IMM # #define SYSCALL0(name, n) \ FUNC(name) \ - moveq.l #$n,%d0 ; \ + move.l IMM n,%d0 ; \ trap #0 ; \ rts #define SYSCALL1(name, n) \ FUNC(name) \ - moveq.l #$n,%d0 ; \ + move.l IMM n,%d0 ; \ trap #0 ; \ rts #define SYSCALL2(name, n) \ FUNC(name) \ - moveq.l #$n,%d0 ; \ + move.l IMM n,%d0 ; \ trap #0 ; \ rts #define SYSCALL3(name, n) \ FUNC(name) \ - moveq.l #$n,%d0 ; \ + move.l IMM n,%d0 ; \ trap #0 ; \ rts #define SYSCALL4(name, n) \ FUNC(name) \ - moveq.l #$n,%d0 ; \ + move.l IMM n,%d0 ; \ trap #0 ; \ rts #define SYSCALL5(name, n) \ FUNC(name) \ - moveq.l #$n,%d0 ; \ + move.l IMM n,%d0 ; \ trap #0 ; \ rts #define SYSCALL6(name, n) \ FUNC(name) \ - moveq.l #$n,%d0 ; \ + move.l IMM n,%d0 ; \ trap #0 ; \ rts #define SYSCALL7(name, n) \ FUNC(name) \ - moveq.l #$n,%d0 ; \ + move.l IMM n,%d0 ; \ trap #0 ; \ rts #define SYSCALL8(name, n) \ FUNC(name) \ - moveq.l #$n,%d0 ; \ + move.l IMM n,%d0 ; \ trap #0 ; \ rts #define SYSCALL9(name, n) \ FUNC(name) \ - moveq.l #$n,%d0 ; \ + move.l IMM n,%d0 ; \ trap #0 ; \ rts #define SYSCALL10(name, n) \ FUNC(name) \ - moveq.l #$n,%d0 ; \ + move.l IMM n,%d0 ; \ trap #0 ; \ rts diff --git a/src/system/libroot/os/arch/m68k/system_time.c b/src/system/libroot/os/arch/m68k/system_time.c index ce8aa13425..a8d13ab612 100644 --- a/src/system/libroot/os/arch/m68k/system_time.c +++ b/src/system/libroot/os/arch/m68k/system_time.c @@ -13,7 +13,7 @@ static vint32 *sConversionFactor; void -__ppc_setup_system_time(vint32 *cvFactor) +__m68k_setup_system_time(vint32 *cvFactor) { sConversionFactor = cvFactor; } @@ -22,7 +22,7 @@ __ppc_setup_system_time(vint32 *cvFactor) bigtime_t system_time(void) { - uint64 timeBase = __ppc_get_time_base(); + uint64 timeBase = __m68k_time_base(); uint32 cv = *sConversionFactor; return (timeBase >> 32) * cv + (((timeBase & 0xffffffff) * cv) >> 32); diff --git a/src/system/libroot/os/arch/m68k/system_time_asm.S b/src/system/libroot/os/arch/m68k/system_time_asm.S index d425d756b2..b9ceae7798 100644 --- a/src/system/libroot/os/arch/m68k/system_time_asm.S +++ b/src/system/libroot/os/arch/m68k/system_time_asm.S @@ -7,15 +7,9 @@ .text -/* int64 __ppc_get_time_base(void) - * r3/r4 +/* int64 __m68k_get_time_base(void) */ -FUNCTION(__ppc_get_time_base): - /* get TB (time base) register */ -carry: mftbu %r3 - mftb %r4 - mftbu %r5 // read the upper half again - cmpw %r3, %r5 // and check if the values have changed - bne carry // try again, if they had - blr +FUNCTION(__m68k_get_time_base): +#warning M68K: implement __m68k_get_time_base() + rts diff --git a/src/system/libroot/os/arch/m68k/time.c b/src/system/libroot/os/arch/m68k/time.c index 3b568e5bf3..182baed6fb 100644 --- a/src/system/libroot/os/arch/m68k/time.c +++ b/src/system/libroot/os/arch/m68k/time.c @@ -23,7 +23,7 @@ __arch_init_time(struct real_time_data *data, bool setDefaults) sRealTimeData->version = 0; } - __ppc_setup_system_time(&sRealTimeData->system_time_conversion_factor); + __m68k_setup_system_time(&sRealTimeData->system_time_conversion_factor); }