diff options
author | Charles Forsyth <charles.forsyth@gmail.com> | 2017-04-20 23:47:36 +0100 |
---|---|---|
committer | Charles Forsyth <charles.forsyth@gmail.com> | 2017-04-20 23:47:36 +0100 |
commit | 8823998c509302a526d8711095f664dd06997234 (patch) | |
tree | 5aa606457cd46b0f6e91ad02539015b994fafb76 | |
parent | 89e2246299bf211388a099e02b0df768f630e197 (diff) |
remove assembly-language functions no longer needed because os-clone.c has gone
-rw-r--r-- | emu/Linux/asm-386.S | 52 | ||||
-rw-r--r-- | emu/Linux/asm-arm.S | 53 | ||||
-rw-r--r-- | emu/Linux/asm-mips.S | 30 | ||||
-rw-r--r-- | emu/Linux/asm-power.S | 33 | ||||
-rw-r--r-- | emu/Linux/asm-spim.S | 29 |
5 files changed, 0 insertions, 197 deletions
diff --git a/emu/Linux/asm-386.S b/emu/Linux/asm-386.S index 31946335..fe5ce6c1 100644 --- a/emu/Linux/asm-386.S +++ b/emu/Linux/asm-386.S @@ -1,59 +1,7 @@ .file "asm-Linux-386.S" -#include "syscall.h" .text /* - * executeonnewstack(void *tos, void (*tramp)(void *arg), void *arg) - */ - - .type executeonnewstack,@function - .global executeonnewstack -executeonnewstack: - pushl %ebp - movl %esp, %ebp - pushl %esi - - movl 8(%ebp), %esi /* get tos */ - subl $4, %esi - movl 16(%ebp), %eax - movl %eax, (%esi) /* stash arg on new stack */ - subl $4, %esi - movl 12(%ebp), %eax - movl %eax, (%esi) /* stash tramp on new stack */ - mov %esi, %esp /* swap stacks pronto */ - popl %eax /* recover the tramp address */ - subl %ebp, %ebp /* stop stack traceback here */ - call *%eax /* and jump to it (ho ho) */ - - /* if we return here, tramp didn't do its job */ - - addl $8, %esp /* clean up for pose value */ - - leal SYS_exit, %eax - int $0x80 - -/* - * unlockandexit(int *key) - * - * NB: the return status may be garbaged if the stack is reused - * between the unlock and the system call, but this should - * not matter since no task is waiting for the result - */ - - .type unlockandexit,@function - .global unlockandexit -unlockandexit: - pushl %ebp - movl %esp, %ebp - - movl 8(%ebp), %esi /* get the key address */ - pushl $0 /* exit status 0 */ - movl $0, %eax /* unlock the stack allocator */ - movl %eax, (%esi) - leal SYS_exit, %eax /* call exit */ - int $0x80 - -/* * umult(ulong m1, ulong m2, ulong *hi) */ diff --git a/emu/Linux/asm-arm.S b/emu/Linux/asm-arm.S index 90a337ff..5446dde6 100644 --- a/emu/Linux/asm-arm.S +++ b/emu/Linux/asm-arm.S @@ -1,60 +1,7 @@ .file "asm-Linux-arm.S" -#include "syscall.h" .text /* - * void executeonnewstack(void *tos, void (*tramp)(void *arg), void *arg) - */ - - .align 2 - .global executeonnewstack - .type executeonnewstack, %function -executeonnewstack: - @ args = 0, pretend = 0, frame = 12 - @ frame_needed = 1, uses_anonymous_args = 0 - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - sub sp, sp, #12 - str r0, [fp, #-16] /* store tos */ - str r1, [fp, #-20] /* store tramp */ - str r2, [fp, #-24] /* store arg */ - ldr r0, [fp, #-24] /* get arg */ - ldr r2, [fp, #-16] /* get tos */ - mov sp, r2 /* set new stack */ - mov lr, pc - blx r1 /* call tramp*/ - - /* if we return here, tramp didn't do it's job */ - mov r0, #0 - mov r7, #SYS_exit - swi 0x0 - ldmea fp, {fp, sp, pc} - .size executeonnewstack, .-executeonnewstack - -/* - * void unlockandexit(int *key) - */ - - .align 2 - .global unlockandexit - .type unlockandexit, %function -unlockandexit: - @ args = 0, pretend = 0, frame = 4 - @ frame_needed = 1, uses_anonymous_args = 0 - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - sub sp, sp, #4 - mov r1, #0 - str r1, [r0] - mov r0, #0 - mov r7, #SYS_exit - swi 0x0 - ldmea fp, {fp, sp, pc} - .size unlockandexit, .-unlockandexit - -/* * ulong umult(ulong m1, ulong m2, ulong *hi) */ diff --git a/emu/Linux/asm-mips.S b/emu/Linux/asm-mips.S index 087b8550..d2780f6a 100644 --- a/emu/Linux/asm-mips.S +++ b/emu/Linux/asm-mips.S @@ -1,37 +1,7 @@ -#include "syscall.h" #include <sys/asm.h> #include <sys/regdef.h> #include <asm/cachectl.h> -/* - * executeonnewstack(void *tos, void (*tramp)(void *arg), void *arg) - */ - -LEAF(executeonnewstack) - and a0,a0,~7 - addu sp,a0,-16 - move a0,a2 - move t9,a1 - jalr t9 - - li v0,SYS_exit - li a0,0 - syscall - - END(executeonnewstack) - -/* - * unlockandexit(int *key) - */ - -LEAF(unlockandexit) - lw a1,0(a0) - li v0,SYS_exit - li a0,0 - sw a0,0(a1) - syscall - END(unlockandexit) - LEAF(FPsave) cfc1 t0, $31 sw t0, 0(a0) /* a0 is argument */ diff --git a/emu/Linux/asm-power.S b/emu/Linux/asm-power.S index 6af21fba..7187f938 100644 --- a/emu/Linux/asm-power.S +++ b/emu/Linux/asm-power.S @@ -59,36 +59,3 @@ _tas: 2: sync blr - -/* - * void - * executeonnewstack(void *tos, void (*tramp)(void *arg), void *arg) - */ - .align 2 - .global executeonnewstack -executeonnewstack: - mr %r1,%r3 /* change stacks */ - stwu %lr,-16(%r1) /* save lr to aid the traceback */ - li %r0,0 - stw %r0,20(%r1) - mr %r3,%r5 - mtctr %r4 - bctrl /* tramp(arg) */ - br - -/* - * void unlockandexit(int *key) - * - * NB: the return status may be garbaged if the stack is reused - * between the unlock and the system call, but this should - * not matter since no task is waiting for the result - */ - .align 2 - .globl unlockandexit -unlockandexit: - li %r0,0x0 - stw %r0,0(%r3) /* unlock */ - li %r0,1 /* sys exit; 234 is exit group */ - li %r3,0 /* exit status */ - sc - br diff --git a/emu/Linux/asm-spim.S b/emu/Linux/asm-spim.S index 087b8550..77ae3d4c 100644 --- a/emu/Linux/asm-spim.S +++ b/emu/Linux/asm-spim.S @@ -1,36 +1,7 @@ -#include "syscall.h" #include <sys/asm.h> #include <sys/regdef.h> #include <asm/cachectl.h> -/* - * executeonnewstack(void *tos, void (*tramp)(void *arg), void *arg) - */ - -LEAF(executeonnewstack) - and a0,a0,~7 - addu sp,a0,-16 - move a0,a2 - move t9,a1 - jalr t9 - - li v0,SYS_exit - li a0,0 - syscall - - END(executeonnewstack) - -/* - * unlockandexit(int *key) - */ - -LEAF(unlockandexit) - lw a1,0(a0) - li v0,SYS_exit - li a0,0 - sw a0,0(a1) - syscall - END(unlockandexit) LEAF(FPsave) cfc1 t0, $31 |