s/ppc/m68k/
Lure the preprocessor to not replace #n by "123" for syscalls... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22739 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
dd68e9e8b4
commit
fac9743e5c
@ -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
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user