Commit Graph

1685 Commits

Author SHA1 Message Date
skrll 46ef072377 Fix for [on]{32,64}
/usr/tests/lib/libc/sys/t_getcontext
/usr/tests/lib/libc/sys/t_swapcontext
/usr/tests/lib/libc/sys/t_ucontext
/usr/tests/lib/libpthread/t_swapcontext

All pass now.

Changes amount to

- saving GP from caller in context for n{32,64}
- performing (the equivalient of) PIC_PROLOGUE for swapcontext and
  __resumecontext
- Call setcontext via the PLT in __resumecontext
2016-09-21 06:49:39 +00:00
skrll ed78dc9b59 Trailing whitespace. 2016-09-21 06:41:42 +00:00
skrll 97239cd361 Add a NOP_L 2016-08-13 08:09:17 +00:00
skrll 48bbbdf1d5 PIC_TAILCALL on n32/n64 would mess up GP, so just use SYSTRAP to call
setcontext.

Fixes tests/lib/libc/sys/t_getcontext.c:setcontext_link
2016-08-13 07:49:32 +00:00
skrll 24c5917e57 Provide _OFFSETOF_UC_GREGS_GP and use _OFFSETOF_UC_GREGS_* in getcontext 2016-08-12 15:26:04 +00:00
skrll f820f85434 Trailing whitespace 2016-08-12 15:21:25 +00:00
skrll 21763d8f6e We need to save the GP of the caller in the context for n32/n64 2016-08-10 16:45:24 +00:00
skrll 7241a8c40f Fix comments 2016-08-10 16:40:24 +00:00
scole 21984c24a3 PR port-ia64/51261
Add stubs for ia64 build
2016-08-05 16:40:47 +00:00
skrll 8f5f191a49 No need to define PSW_MBS as machine/psl.h provides it for us 2016-07-16 09:51:13 +00:00
mrg 5f3362148f various ia64 updates:
- add a compat vfork because of stupid
- add a weak sbrk
- add a shmat syscall
- add an empty kvm implementation that links
- add missing fp stuff
2016-06-30 09:14:30 +00:00
christos 4f0a81a7d2 Save and restore all the registers we need instead of playing tricks and
"knowing" which registers the compiler clobbers. gcc-5.3 clobbers both
rcx and rdx...
2016-03-19 21:27:38 +00:00
christos cb9f529bfe use __register_t 2016-01-25 16:44:42 +00:00
christos 013af8a944 use __register_t 2016-01-24 22:02:48 +00:00
christos 29d18e37d5 cache stuff needs _KERNTYPES 2016-01-24 16:01:56 +00:00
christos 2e41c44fee Use namespace protected types. 2016-01-24 16:01:43 +00:00
christos 54d8ff1b7f assym.h needs _KERNTYPES 2016-01-24 15:55:34 +00:00
pooka 71859f7093 In rumprun mode on ARM, don't build syscall or signal code into libc.
(like on x86)
2015-08-20 16:13:40 +00:00
pooka 7db5875437 Don't include sigtramp or foocontext routines in rumprun mode. They won't
work (since a rump kernel does not provide NetBSD _lwp syscalls nor
signals), but they cause unwanted symbols to be pulled in when the
resulting libc is linked.

problem reported by Robert Gifford on rumpkernel-users
2015-07-15 14:27:49 +00:00
pooka db8ece9eea Remove "objects built from C sources" comments. Everyone can see
they're built from C sources because the source files end in .c (???)
2015-07-15 14:23:40 +00:00
matt cee94c5eb0 Add the fpset* routines for tests 2015-07-07 21:40:19 +00:00
matt 45908a5ffd Some test programs require these. 2015-07-05 22:07:09 +00:00
martin 2a5b63aa81 Add set/longjmp and friends (nearly verbatim from FreeBSD).
Add a dummy _lwp_makecontext() function (enough to make autoconfigury
happy and gcc mknative work)
2015-04-17 12:51:05 +00:00
mrg 2603e0673f remove various HAVE_GCC=45 fragments. 2015-04-15 19:13:46 +00:00
uwe c9951c23e1 On swapcontext(3) preserve r12 too. Properly fixes PR port-sh3/49597. 2015-04-06 01:50:46 +00:00
matt d67e7afb11 Use lla instead doing the pcrel relocs ourselves. 2015-03-31 11:59:41 +00:00
matt 35c3446182 Adapt to new assembler. jump->tail[call] auipc/lo12 changes. 2015-03-27 23:23:14 +00:00
matt 4ec25a89b6 Adapt to the jmpbuf changes. 2015-03-27 23:22:20 +00:00
matt 8a3081d220 Switch to new ABI (return values now in a0/a1; v0/v1 are no more) 2015-03-27 06:44:28 +00:00
joerg b9e2400677 Call libc's fpgetround. 2015-03-19 21:22:59 +00:00
uwe 1a997bcd9f Adjust _UC_MACHINE_SP(oucp) to "drop" values we pushed to the stack.
t_swapcontext tests pass now with gcc 4.8.

From Yasushi Oshima in PR port-sh3/49597
2015-01-25 01:32:26 +00:00
dennis 75a496875b Replace the branch to __cerror() in powerpc64 syscall stubs
with inline code which does what __cerror() was doing.  #ifdef
that code (i.e. all code) out of cerror.S; __cerror() is no more.
This seems to be necessary to fix the link of rescue/rescue, and
should have the pleasant side effect of making all other workarounds
done to keep the 'b __cerror' working unnecessary.
2015-01-12 02:48:20 +00:00
christos 625ac095d3 Fix ptrace %rcx corruption when pthread_errno() is used. Small example:
#include <sys/types.h>
    #include <stdio.h>
    #include <sys/ptrace.h>
    int main(void) { ptrace(18, getpid(), NULL, 0xabcd); }
The -lpthread cases pases 0 instead of 0xabcd
2014-11-24 15:33:18 +00:00
matt 6cf6fe02a9 New files for Userland support of UCB RISC-V (both 32-bit and 64-bit) 2014-09-19 17:36:24 +00:00
joerg d131912831 Explicitly set noat around instructions using $at. 2014-09-17 11:02:55 +00:00
joerg aca672a912 Use canonical three operand form of add.d. 2014-09-17 11:01:05 +00:00
matt abb9139a12 The OpenRISC calling standard only passes 6 parameters by register. Any
others are passed on the stack.  NetBSD syscalls use up to 8 parameters
so that could mean two left on the stack for the kernel to access.  It's
easier for the kernel if userland could fetch into registers beforehand.
So we generate sysassym.h which contains the number of arguments for each
syscall and then use that to determine how many arguments need to be fetched
from the stack.
2014-09-05 18:09:37 +00:00
matt 27620987b8 New files for OR1K support 2014-09-03 19:34:25 +00:00
matt a4055c59ef float32_is_signalling_nan needs a prototype if SOFTFLOATM68K_FOR_GCC is
defined.
2014-09-01 07:33:31 +00:00
matt 38dcdc34d9 Minimize differences between powerpc and powerpc64
Fix powerpc64 assembly to use right instructions for 64bit CPUs.
Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
2014-08-23 02:24:22 +00:00
joerg d213e5903a [] -> () 2014-08-13 15:41:21 +00:00
joerg bd7693847a Spell LdAddr consistently 2014-08-13 15:19:22 +00:00
matt beb9c6d1b5 Preliminary files for AARCH64 (64-bit ARM) support.
Enough for a distribution build.
2014-08-10 05:47:35 +00:00
wiz 87561671c1 defintion -> definition 2014-08-03 19:14:24 +00:00
nakayama 63bc5e6959 Include sparc_v8 library into sparc64 32-bit compat libc library. 2014-07-12 19:21:48 +00:00
nakayama 847b247653 Use save instruction to set up a local stack frame.
This fixes a segmentation fault caused by bash 4.3 on sparc64
kernels with 32-bit userland, bash uses _setjmp/_longjmp heavyly
via sigsetjmp/siglongjmp since 4.3.

For 32-bit compat library which is compiled with -mcpu=ultrasparc
option (and define __sparc_v9__), use a similar code to 64-bit
library.
2014-07-12 19:11:57 +00:00
uebayasi d3e9bed41f Fix previous. 2014-05-23 03:05:56 +00:00
uebayasi 0d34bfa26d Put missing END() markers to set ELF symbol size. 2014-05-23 02:34:19 +00:00
uebayasi d6b02e86d1 Put missing END() markers to set ELF symbol size. 2014-05-23 02:17:43 +00:00
uebayasi 92d1d4411b Put missing END() markers to set ELF symbol size. 2014-05-22 15:01:56 +00:00