home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
network
/
netlib_1
/
NetLibSrc
/
hdr
/
Vars
< prev
Wrap
Text File
|
1995-10-05
|
871b
|
58 lines
;
; This is the code for storing a1 in errno - the SharedCLibrary's
; variable. If $module is defined, then the appropriate relocation
; is performed too
;
IMPORT |__errno|
MACRO
StoreErrno $Temp1, $Temp2
ASSERT $Temp1 <> a1
ASSERT $Temp2 <> a2
ASSERT $Temp1 <> $Temp2
LDR $Temp1, =|__errno| ; find address of errno
[ "$ModuleCode" = "yes"
LDR $Temp2, [sl, #-536] ; if we are a module, find offset
ADD $Temp1, $Temp1, $Temp2 ; and add it in.
]
STR a1, [$Temp1, #0] ; store error in __errno
MEND
MACRO
EnterSVC
[ "$ModuleCode" <> "yes"
STMFD sp!, {sl,lr}
MOV sl, #3
AND sl, sl, pc
SWI XOS_EnterOS
MOV a1, a1
STMFD sp!, {sl}
]
MEND
MACRO
ExitSVC
[ "$ModuleCode" <> "yes"
LDMFD sp!, {sl}
ORRVS sl, sl, #1<<28
TEQP pc, sl
MOV a1, a1
LDMFD sp!, {sl,lr}
]
MEND
MACRO
CallSWI $swiname
EnterSVC
SWI $swiname
ExitSVC
MEND
END