[Wisp-cvs] wisp/src/native death.s,1.1,1.2 sys.s,1.4,1.5 sys.wth,1.5,1.6 wrap.nasm,1.59,1.60
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2002-09-07 22:03:59
|
Update of /cvsroot/wisp/wisp/src/native In directory usw-pr-cvs1:/tmp/cvs-serv7142/src/native Modified Files: death.s sys.s sys.wth wrap.nasm Log Message: Replaced the C-written |sys:fstat|, |sys:lstat|, and |sys:stat| with the Worth-written |sys:ns:fstat|, |sys:ns:lstat|, and |sys:ns:stat|. Index: death.s =================================================================== RCS file: /cvsroot/wisp/wisp/src/native/death.s,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- death.s 4 Sep 2002 14:26:57 -0000 1.1 +++ death.s 7 Sep 2002 22:03:56 -0000 1.2 @@ -4,19 +4,19 @@ .byte 88,232 .long strlen - (.+4) .byte 186,13,0,0,0,185 -.long _G0_ +.long _death.wth_G0_ .byte 187,1,0,0,0,137,199,184,4,0,0,0,205,128,88,137,250,137,193,187,1,0 .byte 0,0,184,4,0,0,0,205,128,186,1,0,0,0,185 -.long _G1_ +.long _death.wth_G1_ .byte 187,1,0,0,0,184,4,0,0,0,205,128,187,1,0,0,0,184,1,0,0,0,205,128 .global die .section .text .align 16 -_G1_: +_death.wth_G1_: .byte 10 -.global _G1_ +.global _death.wth_G1_ .section .text .align 16 -_G0_: +_death.wth_G0_: .byte 119,105,115,112,32,101,110,103,105,110,101,58,32 -.global _G0_ +.global _death.wth_G0_ Index: sys.s =================================================================== RCS file: /cvsroot/wisp/wisp/src/native/sys.s,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sys.s 7 Sep 2002 21:51:50 -0000 1.4 +++ sys.s 7 Sep 2002 22:03:56 -0000 1.5 @@ -1,5 +1,197 @@ .section .text .align 16 +N_sys_ns_lstat: +.byte 144,81,131,249,1,15,132,8,0,0,0,88,137,193,233 +.long N_signal_argcount - (.+4) +.byte 88,232 +.long ws2zt - (.+4) +.byte 91,131,236,64,137,227,83,137,217,137,195,184,107,0,0,0,205,128,80 +.byte 133,192,15,133,11,0,0,0,88,232 +.long struct_stat2list - (.+4) +.byte 233,14,0,0,0,88,91,104 +.long N_sys_ns_lstat.L3 +.byte 80,233 +.long encsi$1 - (.+4) +.byte 80,88,131,196,64,195 +.global N_sys_ns_lstat,NN_sys_ns_lstat,N_sys_ns_lstat.L3 +.equiv NN_sys_ns_lstat, N_sys_ns_lstat + 1 +.equiv N_sys_ns_lstat.L3, N_sys_ns_lstat + 76 +.section .text +.align 16 +N_sys_ns_stat: +.byte 144,81,131,249,1,15,132,8,0,0,0,88,137,193,233 +.long N_signal_argcount - (.+4) +.byte 88,232 +.long ws2zt - (.+4) +.byte 91,131,236,64,137,227,83,137,217,137,195,184,106,0,0,0,205,128,80 +.byte 133,192,15,133,11,0,0,0,88,232 +.long struct_stat2list - (.+4) +.byte 233,14,0,0,0,88,91,104 +.long N_sys_ns_stat.L3 +.byte 80,233 +.long encsi$1 - (.+4) +.byte 80,88,131,196,64,195 +.global N_sys_ns_stat,NN_sys_ns_stat,N_sys_ns_stat.L3 +.equiv NN_sys_ns_stat, N_sys_ns_stat + 1 +.equiv N_sys_ns_stat.L3, N_sys_ns_stat + 76 +.section .text +.align 16 +N_sys_ns_fstat: +.byte 144,81,131,249,1,15,132,8,0,0,0,88,137,193,233 +.long N_signal_argcount - (.+4) +.byte 88,88,104 +.long N_sys_ns_fstat.L1 +.byte 80,233 +.long decui$1 - (.+4) +.byte 131,236,64,137,227,83,137,217,137,195,184,108,0,0,0,205,128,80,133 +.byte 192,15,133,11,0,0,0,88,232 +.long struct_stat2list - (.+4) +.byte 233,14,0,0,0,88,91,104 +.long N_sys_ns_fstat.L4 +.byte 80,233 +.long encsi$1 - (.+4) +.byte 80,88,131,196,64,195 +.global N_sys_ns_fstat,NN_sys_ns_fstat,N_sys_ns_fstat.L1,N_sys_ns_fstat.L4 +.equiv NN_sys_ns_fstat, N_sys_ns_fstat + 1 +.equiv N_sys_ns_fstat.L1, N_sys_ns_fstat + 32 +.equiv N_sys_ns_fstat.L4, N_sys_ns_fstat + 82 +.section .text +.align 16 +struct_stat2list: +.byte 88,91,137,217,131,193,48,139,9,80,83,106,0,104 +.long struct_stat2list.L0 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L1 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,40,139,9,83,80,104 +.long struct_stat2list.L2 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L3 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,32,139,9,83,80,104 +.long struct_stat2list.L4 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L5 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,28,139,9,83,80,104 +.long struct_stat2list.L6 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L7 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,24,139,9,83,80,104 +.long struct_stat2list.L8 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L9 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,20,139,9,83,80,104 +.long struct_stat2list.L10 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L11 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,16,15,183,9,83,80,104 +.long struct_stat2list.L12 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L13 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,14,15,183,9,83,80,104 +.long struct_stat2list.L14 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L15 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,12,15,183,9,83,80,104 +.long struct_stat2list.L16 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L17 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,10,15,183,9,83,80,104 +.long struct_stat2list.L18 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L19 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,8,15,183,9,83,80,104 +.long struct_stat2list.L20 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L21 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,4,139,9,83,80,104 +.long struct_stat2list.L22 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L23 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,137,217,131,193,0,15,183,9,83,80,104 +.long struct_stat2list.L24 +.byte 81,233 +.long encui$1 - (.+4) +.byte 91,104 +.long struct_stat2list.L25 +.byte 80,83,233 +.long cons$2 - (.+4) +.byte 91,91,80,83,195 +.global struct_stat2list,struct_stat2list.L0,struct_stat2list.L1,struct_stat2list.L2,struct_stat2list.L3,struct_stat2list.L4,struct_stat2list.L5,struct_stat2list.L6,struct_stat2list.L7,struct_stat2list.L8,struct_stat2list.L9,struct_stat2list.L10,struct_stat2list.L11,struct_stat2list.L12,struct_stat2list.L13,struct_stat2list.L14,struct_stat2list.L15,struct_stat2list.L16,struct_stat2list.L17,struct_stat2list.L18,struct_stat2list.L19,struct_stat2list.L20,struct_stat2list.L21,struct_stat2list.L22,struct_stat2list.L23,struct_stat2list.L24,struct_stat2list.L25 +.equiv struct_stat2list.L0, struct_stat2list + 24 +.equiv struct_stat2list.L1, struct_stat2list + 37 +.equiv struct_stat2list.L2, struct_stat2list + 58 +.equiv struct_stat2list.L3, struct_stat2list + 71 +.equiv struct_stat2list.L4, struct_stat2list + 92 +.equiv struct_stat2list.L5, struct_stat2list + 105 +.equiv struct_stat2list.L6, struct_stat2list + 126 +.equiv struct_stat2list.L7, struct_stat2list + 139 +.equiv struct_stat2list.L8, struct_stat2list + 160 +.equiv struct_stat2list.L9, struct_stat2list + 173 +.equiv struct_stat2list.L10, struct_stat2list + 194 +.equiv struct_stat2list.L11, struct_stat2list + 207 +.equiv struct_stat2list.L12, struct_stat2list + 229 +.equiv struct_stat2list.L13, struct_stat2list + 242 +.equiv struct_stat2list.L14, struct_stat2list + 264 +.equiv struct_stat2list.L15, struct_stat2list + 277 +.equiv struct_stat2list.L16, struct_stat2list + 299 +.equiv struct_stat2list.L17, struct_stat2list + 312 +.equiv struct_stat2list.L18, struct_stat2list + 334 +.equiv struct_stat2list.L19, struct_stat2list + 347 +.equiv struct_stat2list.L20, struct_stat2list + 369 +.equiv struct_stat2list.L21, struct_stat2list + 382 +.equiv struct_stat2list.L22, struct_stat2list + 403 +.equiv struct_stat2list.L23, struct_stat2list + 416 +.equiv struct_stat2list.L24, struct_stat2list + 438 +.equiv struct_stat2list.L25, struct_stat2list + 451 +.section .text +.align 16 N_sys_ns_unlink: .byte 144,81,131,249,1,15,132,8,0,0,0,88,137,193,233 .long N_signal_argcount - (.+4) Index: sys.wth =================================================================== RCS file: /cvsroot/wisp/wisp/src/native/sys.wth,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sys.wth 7 Sep 2002 21:51:50 -0000 1.5 +++ sys.wth 7 Sep 2002 22:03:56 -0000 1.6 @@ -26,6 +26,8 @@ (macro salloc <: swap (flush) 'salloc$1 jump :>) (macro ws->zt (flush) ws2zt (believe %eax) nip) +(macro cons <: -rot (flush) 'cons$2 jump :>) + (native unix_time dup 0 = argc drop sys.time (flush) 'encsi$1 jump) @@ -134,5 +136,53 @@ (native sys_ns_unlink dup 1 = argc drop ws->zt sys.unlink (flush) 'encsi$1 jump) + +; stat, fstat, lstat need this +(defun struct_stat2list swap + NULL + over stat.ctime@ encui swap cons + over stat.mtime@ encui swap cons + over stat.atime@ encui swap cons + over stat.blocks@ encui swap cons + over stat.blksize@ encui swap cons + over stat.size@ encui swap cons + over stat.rdev@ encui swap cons + over stat.gid@ encui swap cons + over stat.uid@ encui swap cons + over stat.nlink@ encui swap cons + over stat.mode@ encui swap cons + over stat.ino@ encui swap cons + over stat.dev@ encui swap cons + nip swap) + +(native sys_ns_fstat dup 1 = argc drop + decui sizeof.struct-stat.aligned 1 allocate + tuck sys.fstat + dup 0 = if + drop struct_stat2list + else + nip encsi + then + sizeof.struct-stat.aligned 1 deallocate) + +(native sys_ns_stat dup 1 = argc drop + ws->zt sizeof.struct-stat.aligned 1 allocate + tuck sys.stat + dup 0 = if + drop struct_stat2list + else + nip encsi + then + sizeof.struct-stat.aligned 1 deallocate) + +(native sys_ns_lstat dup 1 = argc drop + ws->zt sizeof.struct-stat.aligned 1 allocate + tuck sys.lstat + dup 0 = if + drop struct_stat2list + else + nip encsi + then + sizeof.struct-stat.aligned 1 deallocate) ; vim: ft=worth Index: wrap.nasm =================================================================== RCS file: /cvsroot/wisp/wisp/src/native/wrap.nasm,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- wrap.nasm 22 Jul 2002 14:53:16 -0000 1.59 +++ wrap.nasm 7 Sep 2002 22:03:56 -0000 1.60 @@ -84,10 +84,7 @@ native_wrapper salloc, GC_malloc_atomic, 1, node ;; VERY DANGEROUS! native_wrapper strcomp, 2, node native_wrapper sys_for_dir_entries, 2, node -native_wrapper sys_fstat, 1, node -native_wrapper sys_lstat, 1, node native_wrapper sys_select, 6, node -native_wrapper sys_stat, 1, node native_wrapper truncate, trunc, 1, node native_wrapper unsigned_get_bit, 2, node native_wrapper ws2zt, 1, node |