Commit 6e245d6b authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Retab assembler to reduce diffs.

Not tagged.
......@@ -18,42 +18,42 @@
; Assembler function to enable podule irqs
;
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:EnvNumbers
GET Hdr:ModHand
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:EnvNumbers
GET Hdr:ModHand
GET Hdr:APCS.<APCS>
EXPORT user_mode_donothing
EXPORT splet
EXPORT splimp
EXPORT splnet
EXPORT splx
EXPORT splhi
EXPORT ensure_irqs_on
EXPORT restore_irqs
EXPORT splrestore
EXPORT in_cksum_hdr
EXPORT get_t0_count
EXPORT user_mode_donothing
EXPORT splet
EXPORT splimp
EXPORT splnet
EXPORT splx
EXPORT splhi
EXPORT ensure_irqs_on
EXPORT restore_irqs
EXPORT splrestore
EXPORT in_cksum_hdr
EXPORT get_t0_count
^ 0
^ 0
AREA poduleirqs, PIC, CODE, REL, READONLY
AREA poduleirqs, PIC, CODE, REL, READONLY
ALIGN
ALIGN
; os_error *usermode_donothing();
user_mode_donothing ROUT
FunctionEntry
; Now execute a SWI in user mode to trigger callbacks
; Now execute a SWI in user mode to trigger callbacks
WritePSRc 0, r0 ; IRQs on, user mode
MOV r0, #0
MOV r1, #1
SWI XOS_Byte ; Read OS version
SWI XOS_EnterOS ; Back to SVC mode
MOV r0, #0
MOV r1, #1
SWI XOS_Byte ; Read OS version
SWI XOS_EnterOS ; Back to SVC mode
Return
......@@ -71,8 +71,8 @@ splet
splnet
splimp
[ {CONFIG}=26
AND r0, lr, # I_bit
ORRS pc, lr, # I_bit
AND r0, lr, # I_bit
ORRS pc, lr, # I_bit
|
MRS a1, CPSR
ORR a2, a1, #I32_bit
......@@ -92,8 +92,8 @@ splimp
ensure_irqs_on
[ {CONFIG}=26
AND r0, lr, # I_bit
BICS pc, lr, # I_bit
AND r0, lr, # I_bit
BICS pc, lr, # I_bit
|
MRS a1, CPSR
BIC a2, a1, #I32_bit
......@@ -114,8 +114,8 @@ restore_irqs
splrestore
splx
[ {CONFIG}=26
BIC lr, lr, # I_bit
ORRS pc, lr, r0
BIC lr, lr, # I_bit
ORRS pc, lr, r0
|
MRS a2, CPSR
BIC a2, a2, #I32_bit
......@@ -165,15 +165,15 @@ get_t0_count
;
in_cksum_hdr
; Load 20 bytes of IP header
LDMIA a1,{a1-a4,ip}
; Load 20 bytes of IP header
LDMIA a1,{a1-a4,ip}
; Calculate 1's-complement sum of the 5 32-bit words.
ADDS a1,a1,a2
ADCS a1,a1,a3
ADCS a1,a1,a4
ADCS a1,a1,ip
ADC a1,a1,#0
; Calculate 1's-complement sum of the 5 32-bit words.
ADDS a1,a1,a2
ADCS a1,a1,a3
ADCS a1,a1,a4
ADCS a1,a1,ip
ADC a1,a1,#0
; Fold two 16-bit words together - top half will
; contain the 1's complement sum
......@@ -187,15 +187,15 @@ in_cksum_hdr
Return ,LinkNotStacked
^ 0
m_next # 4
m_list # 4
m_off # 4
m_len # 4
^ 0
m_next # 4
m_list # 4
m_off # 4
m_len # 4
[ {TRUE}
[ {TRUE}
EXPORT in_cksum
EXPORT in_cksum
;
; This routine is engineered to be rapid on cached ARMs.
......@@ -242,148 +242,148 @@ m_len # 4
; In final 64 bytes:
; a3 = number of bits present in final word (0-31)
;
ROUT
ROUT
in_cksum
FunctionEntry "v1-v6,sl,fp"
; Start off checksum and rotate
MOV v3, #0
MOV ip, #0
99 LDR v1,[a1,#m_off]
; v2 = length of mbuf
LDR v2,[a1,#m_len]
; v1 = ptr to data
ADD v1,a1,v1
; if mlen > len, mlen = len
CMPS v2,a2
MOVHI v2,a2
; len -= mlen
SUB a2,a2,v2
ANDS a3,v1,#3
BLNE fiddly
; If we have 64 bytes, do it fast (utilising burst
; reads)
SUBS v2,v2,#64
BMI %F97
0 LDMIA v1!,{a3,a4,v4,v5,v6,sl,fp,lr}
ADDS ip,ip,a3
ADCS ip,ip,a4
ADCS ip,ip,v4
ADCS ip,ip,v5
ADCS ip,ip,v6
ADCS ip,ip,sl
ADCS ip,ip,fp
ADCS ip,ip,lr
LDMIA v1!,{a3,a4,v4,v5,v6,sl,fp,lr}
ADCS ip,ip,a3
ADCS ip,ip,a4
ADCS ip,ip,v4
ADCS ip,ip,v5
ADCS ip,ip,v6
ADCS ip,ip,sl
ADCS ip,ip,fp
ADCS ip,ip,lr
ADC ip,ip,#0
SUBS v2,v2,#64
BGE %B0
; If we have 16 bytes, do it fast (utilising burst
; reads)
97 ADDS v2,v2,#64-16
BMI %F1
98 LDMIA v1!,{a3,a4,v4,v5}
ADDS ip,ip,a3
ADCS ip,ip,a4
ADCS ip,ip,v4
ADCS ip,ip,v5
ADC ip,ip,#0
SUBS v2,v2,#16
BGE %B98
; Right, down to < 16 bytes.
; However we get here, C is clear
; Do we have an "odd" number?
1 ANDS a3,v2,#3 ; Doesn't alter C
BEQ %F2
; Yes we do. Argh!
; a3 is no of bytes present in incomplete word
; Get lr to point to end word
SUB lr,v2,a3
ADD lr,lr,#16
; Load word containing end-point. This will give us a3 bits
; that need to be ignored (high-bits).
LDR a4,[v1,lr]
; set a3 to no of bits present in incomplete word
MOV a3,a3,LSL #3
; set lr to number of bits missing in incomplete word
RSB lr,a3,#32
; clear bits to be ignored
MOV a4,a4,LSL lr
; add incomplete word to checksum
ADDS ip,ip,a4,LSR lr
; reduce amount left to read so the following code
; will only sum remaining whole words
BIC v2,v2,#3
; Now we continue. Note that as we reach label 2, a3 will
; be set to the number of extra bits beyond the complete
; words in the mbuf.
; Branch as appropriate to sum remaining 0-3 words
; Note that state of C as we reach this point is significant;
; if we didn't go through the incomplete word malarky, C
; must be clear, otherwise we take C from previous ADDS
; (although this will of course be clear also).
;
; Can't really loop here as any sort of end-of-loop test
; will corrupt the C flag.
2 SUB pc,pc,v2,LSL #1
NOP
NOP ; Can't get here (honest!)
NOP
LDR a4,[v1],#4 ; 12
ADCS ip,ip,a4
LDR a4,[v1],#4 ; 8
ADCS ip,ip,a4
LDR a4,[v1] ; 4
ADCS ip,ip,a4
ADC ip,ip,#0 ; 0
; Have we finished?
TEQS a2,#0
BEQ %F03
; Now then, now then, now then. If this mbuf did not have
; a complete number of words, the next one will have "rotated
; words". Eg in 3 mbufs of 5 bytes:
;
; [(A B C D) (A)] -> [(B C D A) (B)] -> [(C D A B) (C)]
;
; to cope with this, rotate the checksum so far to match
; the rotation state of the next mbuf (eg rotate it one byte
; left in the above example), and keep track of the total
; rotations done in v3, so we can unwind at the end.
;
MOV ip,ip,ROR a3
SUB v3,v3,a3
; Back to the top for the next mbuf!
LDR a1,[a1,#m_next]
B %B99
3 MOV ip,ip,ROR v3
; Start off checksum and rotate
MOV v3, #0
MOV ip, #0
99 LDR v1,[a1,#m_off]
; v2 = length of mbuf
LDR v2,[a1,#m_len]
; v1 = ptr to data
ADD v1,a1,v1
; if mlen > len, mlen = len
CMPS v2,a2
MOVHI v2,a2
; len -= mlen
SUB a2,a2,v2
ANDS a3,v1,#3
BLNE fiddly
; If we have 64 bytes, do it fast (utilising burst
; reads)
SUBS v2,v2,#64
BMI %F97
0 LDMIA v1!,{a3,a4,v4,v5,v6,sl,fp,lr}
ADDS ip,ip,a3
ADCS ip,ip,a4
ADCS ip,ip,v4
ADCS ip,ip,v5
ADCS ip,ip,v6
ADCS ip,ip,sl
ADCS ip,ip,fp
ADCS ip,ip,lr
LDMIA v1!,{a3,a4,v4,v5,v6,sl,fp,lr}
ADCS ip,ip,a3
ADCS ip,ip,a4
ADCS ip,ip,v4
ADCS ip,ip,v5
ADCS ip,ip,v6
ADCS ip,ip,sl
ADCS ip,ip,fp
ADCS ip,ip,lr
ADC ip,ip,#0
SUBS v2,v2,#64
BGE %B0
; If we have 16 bytes, do it fast (utilising burst
; reads)
97 ADDS v2,v2,#64-16
BMI %F1
98 LDMIA v1!,{a3,a4,v4,v5}
ADDS ip,ip,a3
ADCS ip,ip,a4
ADCS ip,ip,v4
ADCS ip,ip,v5
ADC ip,ip,#0
SUBS v2,v2,#16
BGE %B98
; Right, down to < 16 bytes.
; However we get here, C is clear
; Do we have an "odd" number?
1 ANDS a3,v2,#3 ; Doesn't alter C
BEQ %F2
; Yes we do. Argh!
; a3 is no of bytes present in incomplete word
; Get lr to point to end word
SUB lr,v2,a3
ADD lr,lr,#16
; Load word containing end-point. This will give us a3 bits
; that need to be ignored (high-bits).
LDR a4,[v1,lr]
; set a3 to no of bits present in incomplete word
MOV a3,a3,LSL #3
; set lr to number of bits missing in incomplete word
RSB lr,a3,#32
; clear bits to be ignored
MOV a4,a4,LSL lr
; add incomplete word to checksum
ADDS ip,ip,a4,LSR lr
; reduce amount left to read so the following code
; will only sum remaining whole words
BIC v2,v2,#3
; Now we continue. Note that as we reach label 2, a3 will
; be set to the number of extra bits beyond the complete
; words in the mbuf.
; Branch as appropriate to sum remaining 0-3 words
; Note that state of C as we reach this point is significant;
; if we didn't go through the incomplete word malarky, C
; must be clear, otherwise we take C from previous ADDS
; (although this will of course be clear also).
;
; Can't really loop here as any sort of end-of-loop test
; will corrupt the C flag.
2 SUB pc,pc,v2,LSL #1
NOP
NOP ; Can't get here (honest!)
NOP
LDR a4,[v1],#4 ; 12
ADCS ip,ip,a4
LDR a4,[v1],#4 ; 8
ADCS ip,ip,a4
LDR a4,[v1] ; 4
ADCS ip,ip,a4
ADC ip,ip,#0 ; 0
; Have we finished?
TEQS a2,#0
BEQ %F03
; Now then, now then, now then. If this mbuf did not have
; a complete number of words, the next one will have "rotated
; words". Eg in 3 mbufs of 5 bytes:
;
; [(A B C D) (A)] -> [(B C D A) (B)] -> [(C D A B) (C)]
;
; to cope with this, rotate the checksum so far to match
; the rotation state of the next mbuf (eg rotate it one byte
; left in the above example), and keep track of the total
; rotations done in v3, so we can unwind at the end.
;
MOV ip,ip,ROR a3
SUB v3,v3,a3
; Back to the top for the next mbuf!
LDR a1,[a1,#m_next]
B %B99
3 MOV ip,ip,ROR v3
; Fold two 16-bit words together - top half will
; contain the 1's complement sum
......@@ -395,35 +395,35 @@ in_cksum
; Shift it down to the bottom
MOV a1,a1,LSR #16
; And... relax.
; And... relax.
Return "v1-v6,sl,fp"
; This is very rare, so separate it off down here
; can't be bothered to optimise
; a3 is number of missing bytes
; This is very rare, so separate it off down here
; can't be bothered to optimise
; a3 is number of missing bytes
fiddly
; Check if out of data
TEQS v2,#0
MOVEQ pc,lr
; Load byte
11 LDRB a4,[v1],#1
; Add to checksum
ADDS ip,ip,a4
ADC ip,ip,#0
; Rotate checksum
MOV ip,ip,ROR #8
SUB v3,v3,#8
; Reduce counter
SUBS v2,v2,#1
MOVEQ pc,lr
TSTS v1,#3
BNE %B11
MOV pc,lr
]
END
; Check if out of data
TEQS v2,#0
MOVEQ pc,lr
; Load byte
11 LDRB a4,[v1],#1
; Add to checksum
ADDS ip,ip,a4
ADC ip,ip,#0
; Rotate checksum
MOV ip,ip,ROR #8
SUB v3,v3,#8
; Reduce counter
SUBS v2,v2,#1
MOVEQ pc,lr
TSTS v1,#3
BNE %B11
MOV pc,lr
]
END
......
......@@ -22,169 +22,169 @@
; I have recrafted the tick_handler routine from unixenv.c into
; assembler that can run directly in IRQ mode on TickerV.
NETISR_CALLO * 1
NETISR_CALLO * 1
^ 0
tv_sec # 4
tv_usec # 4
^ 0
tv_sec # 4
tv_usec # 4
^ 0
c_next # 4
c_arg # 4
c_func # 4
c_time # 4
^ 0
c_next # 4
c_arg # 4
c_func # 4
c_time # 4
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:APCS.<APCS>
AREA TickEntry,CODE,READONLY
AREA TickEntry,CODE,READONLY
; The TickerV entry point - we arrive in IRQ mode with IRQs disabled.
EXPORT tick_entry
EXPORT tick_entry
tick_entry
STMFD sp!,{r0-r2,lr}
LDR r2,[r12]
LDR r2,[r2,#8]
LDR r0,P_time
ADD r0,r2,r0
LDR r1,[r0,#tv_usec]
ADD r1,r1,#&0710
ADD r1,r1,#&2000 ; time.tv_usec += 10000
STR r1,[r0,#tv_usec]
SUBS lr,r1,#&000F4000
CMPGE lr,#&240 ; if time.tv_usec >= 1000000
BLT %F1
MOV r1,#0
STR r1,[r0,#tv_usec] ; time.tv_usec = 0
LDR r1,[r0,#tv_sec] ; time.tv_sec ++;
ADD r1,r1,#1
STR r1,[r0,#tv_sec]
1 MOV r0,#0 ; r0=needtocall
LDR r1,P_calltodo
ADD r1,r2,r1 ; sort out relocations
LDR r1,[r1,#c_next] ; r1=calltodo->c_next
TEQS r1,#0
LDMEQFD sp!,{r0-r2,pc}
STMFD sp!,{r0-r2,lr}
LDR r2,[r12]
LDR r2,[r2,#8]
LDR r0,P_time
ADD r0,r2,r0
LDR r1,[r0,#tv_usec]
ADD r1,r1,#&0710
ADD r1,r1,#&2000 ; time.tv_usec += 10000
STR r1,[r0,#tv_usec]
SUBS lr,r1,#&000F4000
CMPGE lr,#&240 ; if time.tv_usec >= 1000000
BLT %F1
MOV r1,#0
STR r1,[r0,#tv_usec] ; time.tv_usec = 0
LDR r1,[r0,#tv_sec] ; time.tv_sec ++;
ADD r1,r1,#1
STR r1,[r0,#tv_sec]
1 MOV r0,#0 ; r0=needtocall
LDR r1,P_calltodo
ADD r1,r2,r1 ; sort out relocations
LDR r1,[r1,#c_next] ; r1=calltodo->c_next
TEQS r1,#0
LDMEQFD sp!,{r0-r2,pc}
0 ; while (r1)
LDR r2,[r1,#c_time]
SUBS r2,r2,#1 ; decrement r1->c_time
STR r2,[r1,#c_time]
BGT break ; if r1->c_time>0 end loop
BEQ break_with_sched ; if r1->c_time==0 do schednetisr
MOV r0,#1 ; set needtocall
LDR r1,[r1,#c_next] ; r1=r1->c_next
TEQS r1,#0
BNE %B0
B break_with_sched
LDR r2,[r1,#c_time]
SUBS r2,r2,#1 ; decrement r1->c_time
STR r2,[r1,#c_time]
BGT break ; if r1->c_time>0 end loop
BEQ break_with_sched ; if r1->c_time==0 do schednetisr
MOV r0,#1 ; set needtocall
LDR r1,[r1,#c_next] ; r1=r1->c_next
TEQS r1,#0
BNE %B0
B break_with_sched
break
TEQS a1,#0 ; check needtocall
LDMEQFD sp!,{r0-r2,pc}
TEQS a1,#0 ; check needtocall
LDMEQFD sp!,{r0-r2,pc}
break_with_sched
LDR a3,[r12]
LDR a3,[a3,#8]
; This code corresponds to:
; schednetisr(NETISR_CALLO); which is a macro:
; netisr |= 1<<NETISR_CALLO;
LDR a1,P_netisr
ADD a1,a3,a1
LDR a2,[a1]
ORR a2,a2,#(1:SHL:NETISR_CALLO)
STR a2,[a1]
; setsoftnet();
; if (callbackflag != 0) then return doing nowt
LDR a1,P_callbackflag
ADD a1,a3,a1
LDR a2,[a1]
TEQS a2,#0
LDMNEFD sp!,{a1-a3,pc}
; callbackflag = 1;
MOV a2,#1
STR a2,[a1]
; callback(CALLB_CALLB);
; struct callback_record *cbptr = callbacks + CALLB_CALLB
LDR a1,P_callbacks
ADD a1,a3,a1 ; Now a1->callback[CALLB_CALLB]
; cbptr->cb_outstanding++;
LDR a2,[a1,#4]
ADD a2,a2,#1
STR a2,[a1,#4]
; os_add_callback(cbptr->cb_entry, module_wsp);
LDR a1,[a1,#0]
MOV a2,r12
; Right, guff to change up into SVC mode to call this SWI.
; This is okay because R12 isn't needed from now on.
LDR a3,[r12]
LDR a3,[a3,#8]
; This code corresponds to:
; schednetisr(NETISR_CALLO); which is a macro:
; netisr |= 1<<NETISR_CALLO;
LDR a1,P_netisr
ADD a1,a3,a1
LDR a2,[a1]
ORR a2,a2,#(1:SHL:NETISR_CALLO)
STR a2,[a1]
; setsoftnet();
; if (callbackflag != 0) then return doing nowt
LDR a1,P_callbackflag
ADD a1,a3,a1
LDR a2,[a1]
TEQS a2,#0
LDMNEFD sp!,{a1-a3,pc}
; callbackflag = 1;
MOV a2,#1
STR a2,[a1]
; callback(CALLB_CALLB);
; struct callback_record *cbptr = callbacks + CALLB_CALLB
LDR a1,P_callbacks
ADD a1,a3,a1 ; Now a1->callback[CALLB_CALLB]
; cbptr->cb_outstanding++;
LDR a2,[a1,#4]
ADD a2,a2,#1
STR a2,[a1,#4]
; os_add_callback(cbptr->cb_entry, module_wsp);
LDR a1,[a1,#0]
MOV a2,r12
; Right, guff to change up into SVC mode to call this SWI.
; This is okay because R12 isn't needed from now on.
[ {CONFIG}=26
MOV r12,pc ; R12 holds PC and PSR
AND r12,r12,#3 ; Extract current mode bits
EOR r12,r12,#3 ; R8 = current mode EOR SVC
TEQP r12,pc ; Enter SVC
NOP
MOV r12,pc ; R12 holds PC and PSR
AND r12,r12,#3 ; Extract current mode bits
EOR r12,r12,#3 ; R8 = current mode EOR SVC
TEQP r12,pc ; Enter SVC
NOP
|
MRS r12,CPSR
ORR lr,r12,#3
MSR CPSR_c,lr
]
STMFD sp!,{lr} ; Save R14_SVC (in case in IRQ mode)
SWI XOS_AddCallBack
LDMFD sp!,{lr} ; Restore R14_SVC
STMFD sp!,{lr} ; Save R14_SVC (in case in IRQ mode)
SWI XOS_AddCallBack
LDMFD sp!,{lr} ; Restore R14_SVC
[ {CONFIG}=26
TEQP r12,pc ; Restore mode, preserving flags
NOP
TEQP r12,pc ; Restore mode, preserving flags
NOP
|
MSR CPSR_c,r12
]
LDMVCFD sp!,{a1-a3,pc}
; if an error
; callbackflag=0;
LDR a1,P_callbackflag
ADD a1,a3,a1
MOV a2,#0
STR a2,[a1]
; callbackerr=1;
LDR a1,P_callbackerr
ADD a1,a3,a1
MOV a2,#1
STR a2,[a1]
LDMFD sp!,{a1-a3,pc}
LDMVCFD sp!,{a1-a3,pc}
; if an error
; callbackflag=0;
LDR a1,P_callbackflag
ADD a1,a3,a1
MOV a2,#0
STR a2,[a1]
; callbackerr=1;
LDR a1,P_callbackerr
ADD a1,a3,a1
MOV a2,#1
STR a2,[a1]
LDMFD sp!,{a1-a3,pc}
P_time
IMPORT kerneltime
DCD kerneltime
IMPORT kerneltime
DCD kerneltime
P_calltodo
IMPORT calltodo
DCD calltodo
IMPORT calltodo
DCD calltodo
P_netisr
IMPORT netisr
DCD netisr
IMPORT netisr
DCD netisr
P_callbackflag
IMPORT callbackflag
DCD callbackflag
IMPORT callbackflag
DCD callbackflag
P_callbacks
IMPORT callbacks
DCD callbacks
IMPORT callbacks
DCD callbacks
P_callbackerr
IMPORT callbackerr
DCD callbackerr
IMPORT callbackerr
DCD callbackerr
; Extracted from ARM Architecture Reference
EXPORT ntohl
ntohl ; a1 = A , B , C , D
EOR a2, a1, a1, ROR #16 ; a2 = A^C,B^D,C^A,D^B
BIC a2, a2, #&ff0000 ; a2 = A^C, 0 ,C^A,D^B
MOV a1, a1, ROR #8 ; a1 = D , A , B , C
EOR a1, a1, a2, LSR #8 ; a1 = D , C , B , A
; Extracted from ARM Architecture Reference
EXPORT ntohl
ntohl ; a1 = A , B , C , D
EOR a2, a1, a1, ROR #16 ; a2 = A^C,B^D,C^A,D^B
BIC a2, a2, #&ff0000 ; a2 = A^C, 0 ,C^A,D^B
MOV a1, a1, ROR #8 ; a1 = D , A , B , C
EOR a1, a1, a2, LSR #8 ; a1 = D , C , B , A
Return ,LinkNotStacked
END
END
......@@ -44,12 +44,12 @@ MessageTrans_ErrorLookup EQU &41506
CMP r7, r8
BEQ |_clib_initialisemodule|
! 0 , "Softload decided upon 0x3800000 as the base of ROM"
CMP r8, #&03800000
BLT |_clib_initialisemodule|
CMP r8, #&03800000
BLT |_clib_initialisemodule|
ADR r0, module_ramload_error
MOV r1, #0
MOV r2, #0
ADR r4, titlestr
ADR r4, titlestr
MOV r5, #0
MOV r6, #0
MOV r7, #0
......@@ -64,6 +64,6 @@ module_ramload_error
DCB "RAMLoadC", 0
titlestr
DCB "Internet", 0
DCB "Internet", 0
END
......@@ -13,74 +13,74 @@
; limitations under the License.
;
XOS_Byte * &20006
XOS_Word * &20007
XOS_Module * &2001E
ModHandReason_Claim * 6
ModHandReason_Free * 7
XOS_Claim * &2001F
XOS_Release * &20020
XOS_GenerateEvent * &20022
XOS_Word * &20007
XOS_Module * &2001E
ModHandReason_Claim * 6
ModHandReason_Free * 7
XOS_Claim * &2001F
XOS_Release * &20020
XOS_GenerateEvent * &20022
XOS_ReadEscapeState * &2002C
XOS_ServiceCall * &20030
XOS_UpCall * &20033
XOS_ReadMonotonicTime * &20042
XOS_AddCallBack * &20054
XOS_ReadSysInfo * &20058
XOS_RemoveCallBack * &2005F
XEconet_InetRxDirect * &6001D
XMessageTrans_FileInfo * &61500
XMessageTrans_OpenFile * &61501
XMessageTrans_Lookup * &61502
XMessageTrans_CloseFile * &61504
XPortable_Speed * &62FC0
XPortable_ReadFeatures * &62FC5
XPortable_Idle * &62FC6
XTaskWindow_TaskInfo * &63380
XMbuf_OpenSession * &6A580
XMbuf_CloseSession * &6A581
XMbuf_Control * &6A584
Service_EnumerateNetworkDrivers * &9B
Service_DCIProtocolStatus * &9F
Service_InternetStatus * &B0
InternetStatus_AddressChanged * 0
InternetStatus_InterfaceUpDown * 2
XOS_ServiceCall * &20030
XOS_UpCall * &20033
XOS_ReadMonotonicTime * &20042
XOS_AddCallBack * &20054
XOS_ReadSysInfo * &20058
XOS_RemoveCallBack * &2005F
XEconet_InetRxDirect * &6001D
XMessageTrans_FileInfo * &61500
XMessageTrans_OpenFile * &61501
XMessageTrans_Lookup * &61502
XMessageTrans_CloseFile * &61504
XPortable_Speed * &62FC0
XPortable_ReadFeatures * &62FC5
XPortable_Idle * &62FC6
XTaskWindow_TaskInfo * &63380
XMbuf_OpenSession * &6A580
XMbuf_CloseSession * &6A581
XMbuf_Control * &6A584
Service_EnumerateNetworkDrivers * &9B
Service_DCIProtocolStatus * &9F
Service_InternetStatus * &B0
InternetStatus_AddressChanged * 0
InternetStatus_InterfaceUpDown * 2
InternetStatus_DynamicBootStart * 3
InternetStatus_DynamicBootReply * 4
InternetStatus_DynamicBootInform * 7
InternetStatus_DuplicateIPAddress * 8
EXPORT mbuf_open_session
EXPORT mbufcontrol_version
EXPORT mbuf_close_session
EXPORT messagetrans_file_info
EXPORT messagetrans_open_file
EXPORT messagetrans_lookup
EXPORT messagetrans_close_file
EXPORT service_dci_protocol_status
EXPORT service_internetstatus_address_changed
EXPORT service_internetstatus_interface_updown
EXPORT mbuf_open_session
EXPORT mbufcontrol_version
EXPORT mbuf_close_session
EXPORT messagetrans_file_info
EXPORT messagetrans_open_file
EXPORT messagetrans_lookup
EXPORT messagetrans_close_file
EXPORT service_dci_protocol_status
EXPORT service_internetstatus_address_changed
EXPORT service_internetstatus_interface_updown
EXPORT service_internetstatus_dynamicboot_start
EXPORT service_internetstatus_dynamicboot_reply
EXPORT service_internetstatus_dynamicboot_inform
EXPORT service_internetstatus_duplicate_ip_address
EXPORT service_enumerate_network_drivers
EXPORT osmodule_free
EXPORT osmodule_claim
EXPORT os_read_monotonic_time
EXPORT os_generate_event
EXPORT os_claim
EXPORT os_release
EXPORT os_add_call_back
EXPORT os_remove_call_back
EXPORT taskwindow_task_info
EXPORT os_upcall
EXPORT econet_inet_rx_direct
EXPORT osreadsysinfo_hardware0
EXPORT osreadsysinfo_machineid
EXPORT osword_read_realtime
EXPORT portable_read_features
EXPORT portable_idle
EXPORT service_enumerate_network_drivers
EXPORT osmodule_free
EXPORT osmodule_claim
EXPORT os_read_monotonic_time
EXPORT os_generate_event
EXPORT os_claim
EXPORT os_release
EXPORT os_add_call_back
EXPORT os_remove_call_back
EXPORT taskwindow_task_info
EXPORT os_upcall
EXPORT econet_inet_rx_direct
EXPORT osreadsysinfo_hardware0
EXPORT osreadsysinfo_machineid
EXPORT osword_read_realtime
EXPORT portable_read_features
EXPORT portable_idle
EXPORT os_read_escape_state
MACRO
......@@ -101,303 +101,303 @@ InternetStatus_DuplicateIPAddress * 8
]
MEND
AREA swiveneers,CODE,READONLY,PIC
AREA swiveneers,CODE,READONLY,PIC
; _kernel_oserror *mbuf_open_session(struct mbctl *);
ROUT
ROUT
mbuf_open_session
MOV ip,lr
SWI XMbuf_OpenSession
MOVVC a1,#0
MOV ip,lr
SWI XMbuf_OpenSession
MOVVC a1,#0
MOVRet ip
; _kernel_oserror *mbufcontrol_version(int *version_out);
ROUT
ROUT
mbufcontrol_version
MOV ip,lr
MOV ip,lr
STR a1,[sp,#-4]!
MOV a1,#0
SWI XMbuf_Control
BVS %F01
LDR lr,[sp]
TEQS lr,#0
STRNE a1,[lr]
MOV a1,#0
01 ADD sp,sp,#4
MOV a1,#0
SWI XMbuf_Control
BVS %F01
LDR lr,[sp]
TEQS lr,#0
STRNE a1,[lr]
MOV a1,#0
01 ADD sp,sp,#4
MOVRet ip
; _kernel_oserror *mbuf_close_session(struct mbctl *);
ROUT
ROUT
mbuf_close_session
MOV ip,lr
SWI XMbuf_CloseSession
MOVVC a1,#0
MOV ip,lr
SWI XMbuf_CloseSession
MOVVC a1,#0
MOVRet ip
; _kernel_oserror *messagetrans_file_info(const char *filename);
ROUT
ROUT
messagetrans_file_info
MOV ip,lr
MOV a2,a1
SWI XMessageTrans_FileInfo
MOVVC a1,#0
MOV ip,lr
MOV a2,a1
SWI XMessageTrans_FileInfo
MOVVC a1,#0
MOVRet ip
; _kernel_oserror *messagetrans_open_file(u_long *fd, const char *filename, char *buffer);
ROUT
ROUT
messagetrans_open_file
MOVS ip,lr
SWI XMessageTrans_OpenFile
MOVVC a1,#0
MOVS ip,lr
SWI XMessageTrans_OpenFile
MOVVC a1,#0
MOVRet ip
; _kernel_oserror *messagetrans_lookup(u_long *fd, const char *token, char *buffer, int size, char **result);
ROUT
ROUT
messagetrans_lookup
MOV ip,sp
STMFD sp!,{v1-v4,lr}
MOV v1,#0
MOV v2,#0
MOV v3,#0
MOV v4,#0
SWI XMessageTrans_Lookup
MOV ip,sp
STMFD sp!,{v1-v4,lr}
MOV v1,#0
MOV v2,#0
MOV v3,#0
MOV v4,#0
SWI XMessageTrans_Lookup
LDMRet "v1-v4",VS
LDR lr,[ip]
TEQS lr,#0
STRNE a3,[lr]
MOV a1,#0
LDR lr,[ip]
TEQS lr,#0
STRNE a3,[lr]
MOV a1,#0
LDMRet "v1-v4"
; void messagetrans_close_file(u_long *fd);
ROUT
ROUT
messagetrans_close_file
MOVS ip,lr
SWI XMessageTrans_CloseFile
MOVS ip,lr
SWI XMessageTrans_CloseFile
MOVRet ip
; void service_dci_protocol_status(void *wsp, int status, int ver, const char *title)
ROUT
ROUT
service_dci_protocol_status
STMFD sp!,{v1,lr}
MOV v1,a4
MOV a4,a3
MOV a3,a2
MOV a2,#Service_DCIProtocolStatus
SWI XOS_ServiceCall
STMFD sp!,{v1,lr}
MOV v1,a4
MOV a4,a3
MOV a3,a2
MOV a2,#Service_DCIProtocolStatus
SWI XOS_ServiceCall
LDMRet "v1"
; void service_internetstatus_address_changed(void)
ROUT
ROUT
service_internetstatus_address_changed
MOV ip,lr
MOV a1,#InternetStatus_AddressChanged
MOV a2,#Service_InternetStatus
SWI XOS_ServiceCall
MOV ip,lr
MOV a1,#InternetStatus_AddressChanged
MOV a2,#Service_InternetStatus
SWI XOS_ServiceCall
MOVRet ip
; void service_internetstatus_interface_updown(int state, const char *name, const void *dib)
ROUT
ROUT
service_internetstatus_interface_updown
STMFD sp!,{v1,lr}
MOV v1,a3
MOV a4,a2
MOV a3,a1
MOV a2,#Service_InternetStatus
MOV a1,#InternetStatus_InterfaceUpDown
SWI XOS_ServiceCall
STMFD sp!,{v1,lr}
MOV v1,a3
MOV a4,a2
MOV a3,a1
MOV a2,#Service_InternetStatus
MOV a1,#InternetStatus_InterfaceUpDown
SWI XOS_ServiceCall
LDMRet "v1"
; int service_internetstatus_dynamicboot_start(const char *name, const void *dib, char *pkt, int len,
; int eoo, int *error_code)
ROUT
ROUT
service_internetstatus_dynamicboot_start
MOV ip, sp
STMFD sp!,{a1-a4,v1-v6,lr}
LDMFD sp!,{a3-a4,v1,v2}
STMFD sp!, {ip}
LDR v3, [ip]
MOV a2,#Service_InternetStatus
MOV a1,#InternetStatus_DynamicBootStart
SWI XOS_ServiceCall
LDMFD sp!, {ip}
LDR a4, [ip, #4]
STRVC a3, [a4]
MOVVS a1, #0
STRVS a1, [a4]
MOVVC a1, a2
MOV ip, sp
STMFD sp!,{a1-a4,v1-v6,lr}
LDMFD sp!,{a3-a4,v1,v2}
STMFD sp!, {ip}
LDR v3, [ip]
MOV a2,#Service_InternetStatus
MOV a1,#InternetStatus_DynamicBootStart
SWI XOS_ServiceCall
LDMFD sp!, {ip}
LDR a4, [ip, #4]
STRVC a3, [a4]
MOVVS a1, #0
STRVS a1, [a4]
MOVVC a1, a2
LDMRet "v1-v6"
; int service_internetstatus_dynamicboot_reply(const char *name, const void *dib, char *pkt, int len)
ROUT
ROUT
service_internetstatus_dynamicboot_reply
STMFD sp!,{a1-a4,v1-v6,lr}
LDMFD sp!,{a3-a4,v1,v2}
MOV a2,#Service_InternetStatus
MOV a1,#InternetStatus_DynamicBootReply
SWI XOS_ServiceCall
MOVVS a1, #Service_InternetStatus
MOVVC a1, a2
STMFD sp!,{a1-a4,v1-v6,lr}
LDMFD sp!,{a3-a4,v1,v2}
MOV a2,#Service_InternetStatus
MOV a1,#InternetStatus_DynamicBootReply
SWI XOS_ServiceCall
MOVVS a1, #Service_InternetStatus
MOVVC a1, a2
LDMRet "v1-v6"
; int service_internetstatus_dynamicboot_inform(char *pkt, int len)
ROUT
ROUT
service_internetstatus_dynamicboot_inform
STMFD sp!,{v1-v6,lr}
MOV a4, a2
MOV a3, a1
MOV a2,#Service_InternetStatus
MOV a1,#InternetStatus_DynamicBootReply
SWI XOS_ServiceCall
MOVVS a1, #Service_InternetStatus
MOVVC a1, a2
STMFD sp!,{v1-v6,lr}
MOV a4, a2
MOV a3, a1
MOV a2,#Service_InternetStatus
MOV a1,#InternetStatus_DynamicBootReply
SWI XOS_ServiceCall
MOVVS a1, #Service_InternetStatus
MOVVC a1, a2
LDMRet "v1-v6"
; int service_internetstatus_duplicate_ip_address(const char *name, const void *dib, struct in_addr addr, u_char *hwaddr)
ROUT
ROUT
service_internetstatus_duplicate_ip_address
STMFD sp!,{v1-v2,lr}
STMFD sp!,{v1-v2,lr}
MOV v2,a4
MOV v1,a3
MOV a4,a2
MOV a3,a1
MOV a2,#Service_InternetStatus
MOV a1,#InternetStatus_DuplicateIPAddress
SWI XOS_ServiceCall
MOVVC a1, a2
MOV a2,#Service_InternetStatus
MOV a1,#InternetStatus_DuplicateIPAddress
SWI XOS_ServiceCall
MOVVC a1, a2
LDMRet "v1-v2"
; void service_enumerate_network_drivers(ChDibRef *)
ROUT
ROUT
service_enumerate_network_drivers
MOV ip,lr
MOV a4,a1
MOV a1,#0
MOV a2,#Service_EnumerateNetworkDrivers
SWI XOS_ServiceCall
STRVC a1,[a4]
MOVVC a1,#0
MOV ip,lr
MOV a4,a1
MOV a1,#0
MOV a2,#Service_EnumerateNetworkDrivers
SWI XOS_ServiceCall
STRVC a1,[a4]
MOVVC a1,#0
MOVRet ip
; void *osmodule_claim(size_t size)
ROUT
ROUT
osmodule_claim
MOV ip,lr
MOV a4,a1
MOV a1,#ModHandReason_Claim
SWI XOS_Module
MOVVC a1,a3
MOVVS a1,#0
MOV ip,lr
MOV a4,a1
MOV a1,#ModHandReason_Claim
SWI XOS_Module
MOVVC a1,a3
MOVVS a1,#0
MOVRet ip
; void osmodule_free(void *)
ROUT
ROUT
osmodule_free
MOV ip,lr
MOV a3,a1
MOV a1,#ModHandReason_Free
SWI XOS_Module
MOV ip,lr
MOV a3,a1
MOV a1,#ModHandReason_Free
SWI XOS_Module
MOVRet ip
; u_long os_read_monotonic_time(void)
ROUT
ROUT
os_read_monotonic_time
MOV ip,lr
SWI XOS_ReadMonotonicTime
MOV ip,lr
SWI XOS_ReadMonotonicTime
MOVRet ip
; _kernel_oserror *os_generate_event(int, int, int, int)
ROUT
ROUT
os_generate_event
MOV ip,lr
SWI XOS_GenerateEvent
MOVVC a1,#0
MOV ip,lr
SWI XOS_GenerateEvent
MOVVC a1,#0
MOVRet ip
; _kernel_oserror *os_claim(int, int (*fun)(), void *)
ROUT
ROUT
os_claim
MOV ip,lr
SWI XOS_Claim
MOVVC a1,#0
MOV ip,lr
SWI XOS_Claim
MOVVC a1,#0
MOVRet ip
; void os_release(int, int (*fun)(), void *)
ROUT
ROUT
os_release
MOV ip,lr
SWI XOS_Release
MOV ip,lr
SWI XOS_Release
MOVRet ip
; _kernel_oserror *os_add_call_back(int (*fun)(), void *)
ROUT
ROUT
os_add_call_back
MOV ip,lr
SWI XOS_AddCallBack
MOVVC a1,#0
MOV ip,lr
SWI XOS_AddCallBack
MOVVC a1,#0
MOVRet ip
; void os_remove_call_back(int (*fun)(), void *)
ROUT
ROUT
os_remove_call_back
MOV ip,lr
SWI XOS_RemoveCallBack
MOV ip,lr
SWI XOS_RemoveCallBack
MOVRet ip
; int econet_inet_rx_direct(int, int, int, int, int, int, int)
ROUT
ROUT
econet_inet_rx_direct
MOV ip,sp
STMFD sp!,{v1-v3,lr}
LDMIA ip,{v1-v3}
SWI XEconet_InetRxDirect
MOV a1,a2
MOV ip,sp
STMFD sp!,{v1-v3,lr}
LDMIA ip,{v1-v3}
SWI XEconet_InetRxDirect
MOV a1,a2
LDMRet "v1-v3"
; _kernel_oserror *taskwindow_task_info(int, int *)
ROUT
ROUT
taskwindow_task_info
MOV ip,lr
MOV a4,a2
SWI XTaskWindow_TaskInfo
STRVC a1,[a4]
MOVVC a1,#0
MOV ip,lr
MOV a4,a2
SWI XTaskWindow_TaskInfo
STRVC a1,[a4]
MOVVC a1,#0
MOVRet ip
; int os_upcall(int, volatile void *)
ROUT
ROUT
os_upcall
MOV ip,lr
SWI XOS_UpCall
MOV ip,lr
SWI XOS_UpCall
MOVRet ip
; unsigned osreadsysinfo_hardware0(void)
ROUT
ROUT
osreadsysinfo_hardware0
STMFD sp!,{v1,lr}
MOV a1,#2
SWI XOS_ReadSysInfo
MOVVS a1,#0
STMFD sp!,{v1,lr}
MOV a1,#2
SWI XOS_ReadSysInfo
MOVVS a1,#0
LDMRet "v1"
; void osreadsysinfo_machineid(unsigned int *mac)
ROUT
ROUT
osreadsysinfo_machineid
STMFD sp!,{v1,lr}
MOV ip,a1
MOV a1,#2
SWI XOS_ReadSysInfo
STMVCIA ip,{a4,v1}
STMFD sp!,{v1,lr}
MOV ip,a1
MOV a1,#2
SWI XOS_ReadSysInfo
STMVCIA ip,{a4,v1}
LDMRet "v1"
; void osword_read_realtime(machinetime *mt)
ROUT
ROUT
osword_read_realtime
MOV ip,lr
MOV a2,a1
MOV a1,#14
MOV lr,#3
STRB lr,[a2]
SWI XOS_Word
MOV ip,lr
MOV a2,a1
MOV a1,#14
MOV lr,#3
STRB lr,[a2]
SWI XOS_Word
MOVRet ip
PortableFeature_Speed * 1 :SHL: 0
......@@ -405,24 +405,24 @@ PortableFeature_Idle * 1 :SHL: 4
PortableFeature_Stop * 1 :SHL: 5
; unsigned portable_read_features(void)
ROUT
ROUT
portable_read_features
MOV ip,lr
SWI XPortable_ReadFeatures ; Returns features mask in R1
BVC %FT01
MOV a1,#0 ; Not available - may be an A4.
MVN a2,#0 ; See if we have Portable_Speed.
SWI XPortable_Speed
MOVVC a2,#PortableFeature_Speed
MOVVS a2,#0
01 MOV a1,a2
MOV ip,lr
SWI XPortable_ReadFeatures ; Returns features mask in R1
BVC %FT01
MOV a1,#0 ; Not available - may be an A4.
MVN a2,#0 ; See if we have Portable_Speed.
SWI XPortable_Speed
MOVVC a2,#PortableFeature_Speed
MOVVS a2,#0
01 MOV a1,a2
MOVRet ip
; void portable_idle(void)
ROUT
ROUT
portable_idle
MOV ip,lr
SWI XPortable_Idle
MOV ip,lr
SWI XPortable_Idle
MOVRet ip
; int os_read_escape_state(void)
......@@ -434,4 +434,4 @@ os_read_escape_state
MOVCS a1,#1
MOVRet ip
END
END
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment