search for: __syscall_common

Displaying 20 results from an estimated 48 matches for "__syscall_common".

2005 Nov 25
0
Fix syscalls with more than four arguments on parisc
...rch/parisc/syscall.S new file mode 100644 index 0000000..a4f26f5 --- /dev/null +++ b/klibc/arch/parisc/syscall.S @@ -0,0 +1,36 @@ +/* + * arch/parisc/syscall.S + * + * %r20 contains the system call number, %r2 contains whence we came + * + */ + + .text + .align 64 ; cache-width aligned + .globl __syscall_common + .type __syscall_common,@function +__syscall_common: + ldo 0x40(%sp),%sp + stw %rp,-0x54(%sp) ; save return pointer + + ldw -0x74(%sp),%r22 ; %arg4 + ldw -0x78(%sp),%r21 ; %arg5 + + ble 0x100(%sr2, %r0) ; jump to gateway page + nop ; can we move a load here? + + ldi -0x1000,%r19...
2006 May 01
2
klibc: s390 errno...
I'm trying to do a full rebase (history clean) of the klibc kernel tree, and came across the following changesets between klibc 1.3.12 and .16: --- a/usr/klibc/arch/s390/syscall.c +++ b/usr/klibc/arch/s390/syscall.c @@ -11,6 +11,6 @@ long int __syscall_common(long int err) { if ((unsigned long)(err) < (unsigned long)(-125)) return err; - errno = err; + errno = -err; return -1; } diff --git a/usr/klibc/arch/s390x/syscall.c b/usr/klibc/arch/s390x/syscall.c index 0d6b27e..c0f17c4 100644 --- a/usr/klibc/...
2011 Jan 29
1
[PATCH] Re: klibc barfs on m68k syscall interface
.../klibc/arch/m68k/syscall.S +=================================================================== +--- klibc-1.5.21.orig/usr/klibc/arch/m68k/syscall.S 2011-01-29 13:28:39.000000000 +0100 ++++ klibc-1.5.21/usr/klibc/arch/m68k/syscall.S 2011-01-29 15:47:09.000000000 +0100 +@@ -11,17 +11,47 @@ + .globl __syscall_common + .type __syscall_common, @function + __syscall_common: +- movem.l %d2-%d6, -(%sp) /* 5 registers saved */ +- movem.l 24(%sp), %d1-%d6 ++#if 0 ++ /* debugging: define "int32_t last_syscall;" in your code... */ ++ move.l %d0, (last_syscall) /* to see which is actually run */ ++#endif ++ /...
2011 Jan 29
0
[PATCH] Fix m68k syscall API and support 6-argument syscalls.
...c/arch/m68k/vfork.S | 13 +++-------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/usr/klibc/arch/m68k/syscall.S b/usr/klibc/arch/m68k/syscall.S index 966c92d..f468678 100644 --- a/usr/klibc/arch/m68k/syscall.S +++ b/usr/klibc/arch/m68k/syscall.S @@ -11,17 +11,43 @@ .globl __syscall_common .type __syscall_common, @function __syscall_common: - movem.l %d2-%d6, -(%sp) /* 5 registers saved */ - movem.l 24(%sp), %d1-%d6 + /* + * According to eglibc, separate moves are faster than movem; + * speed is important and this code is not duplicated anyway, + * so we do the same here. We us...
2017 Dec 30
0
[PATCH] Fix sparc assembly when compiled as PIC
...sr/klibc/arch/sparc/syscall.S b/usr/klibc/arch/sparc/syscall.S index c0273f77..52a8583b 100644 --- a/usr/klibc/arch/sparc/syscall.S +++ b/usr/klibc/arch/sparc/syscall.S @@ -4,14 +4,16 @@ * Common system-call stub; %g1 already set to syscall number */ +#include <machine/asm.h> + .globl __syscall_common .type __syscall_common,#function .align 4 __syscall_common: t 0x10 bcc 1f - sethi %hi(errno), %g4 - or %g4, %lo(errno), %g4 + PIC_PROLOGUE(%g1,%g4) + SET(errno,%g1,%g4) st %o0,[%g4] mov -1, %o0 1: diff --git a/usr/klibc/arch/sparc/sysfork.S b/usr/klibc/arch/sparc/sysfork.S...
2006 Jul 07
0
[patch] s390: fix six parameter handling in sysstub.ph
...}\n"; - print OUT ".else\n"; - print OUT "\tla %r1,__NR_${sname}\n"; - print OUT "\tsvc 0\n"; - print OUT ".endif\n"; - - print OUT "#ifndef __s390x__\n"; - - print OUT "\tbras %r3,1f\n"; - print OUT "\t.long __syscall_common\n"; - print OUT "1:\tl %r3,0(%r3)\n"; - print OUT "\tbr %r3\n"; + foreach $t (@args) { + $r += ($typesize{$t} == 8) ? $llregs : 1; + } - print OUT "#else\n"; - - print OUT "\tbrasl %r3,__syscall_common\n"; - - print OUT "#...
2017 Dec 30
6
building debug version of klibc
Hello! Can someone please help me in building debug version of klibc ? I've cloned git://git.kernel.org/pub/scm/libs/klibc/klibc.git , but failed to build it with debug info added "-g" to HOSTCFLAGS in Makefile, but $ make -j KLIBCKERNELSRC=`pwd`/../linux-2.6/usr still strips every debug symbol , and i'm failed to change scripts/Kbuild.klibc and Makefile to remove strip
2019 Jan 18
0
[klibc:master] Fix sparc assembly when compiled as PIC
.../usr/klibc/arch/sparc/syscall.S b/usr/klibc/arch/sparc/syscall.S index c0273f7..52a8583 100644 --- a/usr/klibc/arch/sparc/syscall.S +++ b/usr/klibc/arch/sparc/syscall.S @@ -4,14 +4,16 @@ * Common system-call stub; %g1 already set to syscall number */ +#include <machine/asm.h> + .globl __syscall_common .type __syscall_common,#function .align 4 __syscall_common: t 0x10 bcc 1f - sethi %hi(errno), %g4 - or %g4, %lo(errno), %g4 + PIC_PROLOGUE(%g1,%g4) + SET(errno,%g1,%g4) st %o0,[%g4] mov -1, %o0 1: diff --git a/usr/klibc/arch/sparc/sysfork.S b/usr/klibc/arch/sparc/sysfork.S...
2006 Jun 26
0
[klibc 30/43] parisc support for klibc
.../parisc/syscall.S new file mode 100644 index 0000000..0ff2a65 --- /dev/null +++ b/usr/klibc/arch/parisc/syscall.S @@ -0,0 +1,36 @@ +/* + * arch/parisc/syscall.S + * + * %r20 contains the system call number, %r2 contains whence we came + * + */ + + .text + .align 64 ; cache-width aligned + .globl __syscall_common + .type __syscall_common, at function +__syscall_common: + ldo 0x40(%sp),%sp + stw %rp,-0x54(%sp) ; save return pointer + + ldw -0x74(%sp),%r22 ; %arg4 + ldw -0x78(%sp),%r21 ; %arg5 + + ble 0x100(%sr2, %r0) ; jump to gateway page + nop ; can we move a load here? + + ldi -0x1000,%r1...
2006 Jun 26
0
[klibc 22/43] arm support for klibc
...mp,.-longjmp + +#endif /* __thumb__ */ diff --git a/usr/klibc/arch/arm/syscall.S b/usr/klibc/arch/arm/syscall.S new file mode 100644 index 0000000..5bc291d --- /dev/null +++ b/usr/klibc/arch/arm/syscall.S @@ -0,0 +1,61 @@ +/* + * arch/arm/syscall.S + * + * System call common handling + */ + + .type __syscall_common,#function + .globl __syscall_common +#ifndef __thumb__ + /* ARM version - this is executed after the swi, unless + we are compiled in EABI mode */ + + .balign 4 +__syscall_common: +#ifdef __ARM_EABI__ + ldr r4, [sp,#16] + ldr r5, [sp,#20] + ldr r7, [lr] + swi 0 +#endif + cmn r0, #4096...
2019 Jan 18
0
[klibc:master] arch: Remove m32r port
.../m32r/syscall.S - * - * r7 contains the syscall number (set by stub); - * r0..r3 contains arguments 0-3 per standard calling convention; - * r4..r5 contains arguments 4-5, but we have to get those from - * the stack. - */ - - .section ".text","ax" - .balign 4 - .globl __syscall_common - .type __syscall_common, at function -__syscall_common: - ld r4, at sp - ld r5,@(4,sp) - trap #2 - cmpi r0, #-4096 - bnc 1f - jmp r14 -1: - seth r2,#high(errno) - or3 r2,r2,#low(errno) - neg r1,r0 - st r1, at r7 - ldi r0,#-1 - jmp r14 - - .size __syscall_common,.-__syscall_common diff --git a/usr/...
2006 May 08
0
[patch] s390 syscall.c declare err
commit 54599b2bfd5e0c66d74c721f0a96acb4822a64d7 removed err declaration usr/klibc/arch/s390/syscall.c: In function '__syscall_common': usr/klibc/arch/s390/syscall.c:10: error: parameter name omitted usr/klibc/arch/s390/syscall.c:12: error: 'err' undeclared (first use in this function) Signed-off-by: maximilian attems <maks@sternwelten.at> diff --git a/usr/klibc/arch/s390/syscall.c b/usr/klibc/arch/s390/syscal...
2006 Jun 26
0
[klibc 26/43] m32r support for klibc
.../m32r/syscall.S + * + * r7 contains the syscall number (set by stub); + * r0..r3 contains arguments 0-3 per standard calling convention; + * r4..r5 contains arguments 4-5, but we have to get those from + * the stack. + */ + + .section ".text","ax" + .balign 4 + .globl __syscall_common + .type __syscall_common, at function +__syscall_common: + ld r4, at sp + ld r5,@(4,sp) + trap #2 + cmpi r0, #-4096 + bnc 1f + jmp r14 +1: + seth r2,#high(errno) + or3 r2,r2,#low(errno) + neg r1,r0 + st r1, at r7 + ldi r0,#-1 + jmp r14 + + .size __syscall_common,.-__syscall_common diff --git a/usr/...
2006 Jun 26
0
[klibc 27/43] m68k support for klibc
....S new file mode 100644 index 0000000..966c92d --- /dev/null +++ b/usr/klibc/arch/m68k/syscall.S @@ -0,0 +1,27 @@ +/* + * arch/m68k/syscall.S + * + * Common tail-handling code for system calls. + * + * The arguments are on the stack; the system call number in %d0. + */ + + .text + .align 2 + .globl __syscall_common + .type __syscall_common, @function +__syscall_common: + movem.l %d2-%d6, -(%sp) /* 5 registers saved */ + movem.l 24(%sp), %d1-%d6 + trap #0 + cmpi.l #-4095, %d0 + blt.l 1f + neg.l %d0 + move.l %d0, (errno) + moveq #-1, %d0 +1: + movea.l %d0, %a0 /* Redundant return */ + movem.l (%sp)+, %d2-%d6 /*...
2012 Jan 29
5
[PATCH 0/2 v3] mkstemp() and m68k support
Hi, after a year, I decided to hack on klibc again. I?ve reworked both the patch to add mkstemp(), discussing to use AT_RANDOM as cheap entropy source on IRC (if there will ever be another entropy consumer, I can quickly write a minimal arc4random() seeded from it, as it has only 16 octets), capable of making a working mksh (static and shared) on amd64/xen, and the m68k support code, leading to
2006 Jun 26
0
[klibc 21/43] alpha support for klibc
...mp + .end longjmp diff --git a/usr/klibc/arch/alpha/syscall.S b/usr/klibc/arch/alpha/syscall.S new file mode 100644 index 0000000..ae69ef2 --- /dev/null +++ b/usr/klibc/arch/alpha/syscall.S @@ -0,0 +1,26 @@ +# +# arch/alpha/syscall.S +# + +#include <machine/asm.h> + + .text + .align 3 + .type __syscall_common, at function + .ent __syscall_common, 0 + .globl __syscall_common +__syscall_common: + .frame sp,0,ra,0 + callsys + beq a3, 1f + br pv, 2f # pv <- pc +2: + ldgp gp, 0(pv) + lda a1, errno + stl v0, 0(a1) + lda v0, -1(zero) +1: + ret zero,(ra),1 + + .size __syscall_common,.-__syscall_common + .e...
2006 Jun 26
0
[klibc 37/43] x86_64 support for klibc
...0000000..1797797 --- /dev/null +++ b/usr/klibc/arch/x86_64/syscall.S @@ -0,0 +1,28 @@ +/* + * arch/x86-64/syscall.S + * + * Common tail-handling code for system calls. + * + * The arguments are in the standard argument registers; the system + * call number in %eax. + */ + .text + .align 4 + .globl __syscall_common + .type __syscall_common, at function +__syscall_common: + movq %rcx,%r10 # The kernel uses %r10 istf %rcx + syscall + + cmpq $-4095,%rax + jnb 1f + ret + + # Error return, must set errno +1: + negl %eax + movl %eax,errno(%rip) # errno is type int, so 32 bits + orq $-1,%rax # orq $-1 smaller than...
2006 Jun 26
0
[klibc 23/43] cris support for klibc
...ns the syscall number (set by generated stub); + * r10..r13 contain arguments 0-3 per the standard calling convention, + * and arguments 4-5 are passed in $mof and $srp; however, we have + * to save $srp around the system call. + */ + + .section ".text","ax" + .balign 4 + .globl __syscall_common + .type __syscall_common, at function +__syscall_common: + push $srp + move [$sp+4],$mof + move [$sp+8],$srp + break 13 + + cmps.w -4096,$r10 + blo 1f + neg.d $r10,$r11 + move.d $r11,[errno] + moveq -1,$r10 +1: + pop $srp + ret + nop + + .size __syscall_common,.-__syscall_common diff --git a/usr/kl...
2020 Apr 30
0
[klibc:master] arch: Remove cris port
...ns the syscall number (set by generated stub); - * r10..r13 contain arguments 0-3 per the standard calling convention, - * and arguments 4-5 are passed in $mof and $srp; however, we have - * to save $srp around the system call. - */ - - .section ".text","ax" - .balign 4 - .globl __syscall_common - .type __syscall_common, at function -__syscall_common: - push $srp - move [$sp+4],$mof - move [$sp+8],$srp - break 13 - - cmps.w -4096,$r10 - blo 1f - neg.d $r10,$r11 - move.d $r11,[errno] - moveq -1,$r10 -1: - pop $srp - ret - nop - - .size __syscall_common,.-__syscall_common diff --git a/usr/kl...
2004 Jun 23
4
CRIS port of klibc
...N ./klibc/arch/cris/syscall.S ../klibc-0.146-modified/klibc/arch/cris/syscall.S --- ./klibc/arch/cris/syscall.S Thu Jun 10 08:59:15 2004 +++ ../klibc-0.146-modified/klibc/arch/cris/syscall.S Wed Jun 23 10:36:07 2004 @@ -9,9 +9,9 @@ .section ".text","ax" .balign 4 - .globl ___syscall_common - .type ___syscall_common,@function -___syscall_common: + .globl __syscall_common + .type __syscall_common,@function +__syscall_common: push $srp move [$sp+4],$mof move [$sp+8],$srp @@ -19,11 +19,12 @@ cmp.d -4096,$r10 blt 1f - neg.d $r10,$r11 - move.d $r11,[_errno] + neg.d $r10,$r11...