Commit Graph

154 Commits

Author SHA1 Message Date
dsl c578e8d211 Rename MDP_IRET to MDL_IRET since it is an lwp flag, not a proc one.
Add an MDL_COMPAT32 flag to the lwp's md_flags, set it for 32bit lwps
  and use it to force 'return to user' with iret (as is done when
  MDL_IRET is set).
Split the iret/sysret code paths much later.
Remove all the replicated code for 32bit system calls - which was only
  needed so that iret was always used.
frameasm.h for XEN contains '#define swapgs', while XEN probable never
  needs swapgs, this is likely to be confusing.
Add a SWAPGS which is a nop on XEN and swapgs otherwise.
(I've not yet checked all the swapgs in files that include frameasm.h)
Simple x86 programs still work.
Hijack 6.99.9 kernel bump (needed for compat32 modules)
2012-07-15 15:17:56 +00:00
christos c35446cdef regen 2012-07-13 18:21:45 +00:00
christos 643208810c add xattr stubs 2012-07-13 18:21:33 +00:00
dsl d222864098 The MDP_USEDFPU (amd64 and sh3) and MDP_SSTEP (sh3) are lwp flags not
process ones, rename to MDL_xxx.
2012-07-08 20:14:11 +00:00
christos 15c591f469 regen 2012-05-10 19:41:52 +00:00
christos de41ffce81 Fix rt_sigtimedwait():
It is wishful thinking that:
    1. declaring a 32 bit syscall with 64 bit pointers
    2. passing a struct with 32 bit pointers to a 64 bit function
is going to work.
2012-05-10 19:40:46 +00:00
christos 6f5d4fe4a7 regen 2011-11-18 04:20:16 +00:00
christos 30d1f33e42 add sigtimedwait support 2011-11-18 04:08:56 +00:00
alnsn 466d6e1aa9 Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura. 2011-05-30 21:37:37 +00:00
alnsn dab2e0b58e Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32. 2011-05-30 17:50:31 +00:00
christos 53dcc5263b Regen: XXX: produces errors because of rump changes! 2011-04-10 15:48:01 +00:00
christos bd81400360 add pipe2 and dup3 2011-04-10 15:47:21 +00:00
joerg 48717cfc00 Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-03-04 22:25:24 +00:00
chs 1bb795ff6c move macros for validating fs/gs to segments.h and use them
in the linux32 code as well.
2011-02-07 03:54:45 +00:00
chs 45bce0e50a regen 2010-11-02 18:15:39 +00:00
chs fc7a196102 implement the following syscalls for linux32:
truncate64
  ftruncate64
  profil
  ioperm
  iopl
  setdomainname
  modify_ldt
  statfs64
  fstatfs64

note that iopl(), ioperm() and modify_ldt() just call
the respective 64-bit handlers, which don't do anything yet.
2010-11-02 18:14:05 +00:00
christos e86c125420 fix debugging build. 2010-07-12 02:55:17 +00:00
jmmv 6f19690766 Add missing includes to bring the linux_semun type needed by
linux_syscallargs.h.
2010-07-07 12:43:18 +00:00
chs d916122e7d regen 2010-07-07 01:31:51 +00:00
chs 33fa5ccbbf many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
 - support new-style (NPTL) linux pthreads on all platforms.
   clone() with CLONE_THREAD uses 1 process with many LWPs
   instead of separate processes.
 - move the contents of sys__lwp_setprivate() into a new
   lwp_setprivate() and use that everywhere.
 - update linux_release[] and linux32_release[] to "2.6.18".
 - adjust placement of emul fork/exec/exit hooks as needed
   and adjust other emul code to match.
 - convert all struct emul definitions to use named initializers.
 - change the pid allocator to allow multiple pids to refer to the same proc.
 - remove a few fields from struct proc that are no longer needed.
 - disable the non-functional "vdso" code in linux32/amd64,
   glibc works fine without it.
 - fix a race in the futex code where we could miss a wakeup after
   a requeue operation.
 - redo futex locking to be a little more efficient.
2010-07-07 01:30:32 +00:00
jym bc0420413d This patch fixes the NX regression issue observed on amd64 kernels, where
per-page execution right was disabled (therefore leading to the inability
of the kernel to detect fraudulent use of memory mappings marked as not
being executable).

- replace cpu_feature and ci_feature_flags variables by cpu_feature and
ci_feat_val arrays. This makes it cleaner and brings kernel code closer
to the design of cpuctl(8). A warning will be raised for each CPU that
does not expose the same features as the Boot Processor (BP).

- the blacklist of CPU features is now a macro defined in the
specialreg.h header, instead of hardcoding it inside MD initialization
code; fix comments.

- replace checks against CPUID_TSC with the cpu_hascounter() function.

- clean up the code in init_x86_64(), as cpu_feature variables are set
inside cpu_probe().

- use cpu_init_msrs() for i386. It will be eventually used later for NX
feature under i386 PAE kernels.

- remove code that checks for CPUID_NOX in amd64 mptramp.S, this is already
performed by cpu_hatch() through cpu_init_msrs().

- remove cpu_signature and feature_flags members from struct mpbios_proc
(they were never used).

This patch was tested with i386 MONOLITHIC, XEN3PAE_DOM0 and XEN3_DOM0 under
a native i386 host, and amd64 GENERIC, XEN3_DOM0 via QEMU virtual machines.

XXX Should kernel rev be bumped?

XXX A similar patch should be pulled-up for NetBSD-5, hopefully tomorrow.
2010-04-18 23:47:50 +00:00
njoly 4898628cc1 Regen for personality(2) update. 2009-11-24 10:44:41 +00:00
njoly 675b20da1b Update personality(2) to match Linux definition where the argument is an
unsigned long.
2009-11-24 10:42:43 +00:00
rmind eaddd78061 Use lwp_getpcb() in compat code, clean from struct user. 2009-11-23 00:46:06 +00:00
njoly add168f4d8 Fix defines against multiple inclusion protection (s/I386/AMD64). 2009-06-08 14:42:10 +00:00
njoly e1a778e452 Regen for rt_queueinfo addition. 2009-06-08 13:41:17 +00:00
njoly 9c8407cd8f Add rt_queueinfo(2) support. 2009-06-08 13:34:23 +00:00
njoly b0b09eac89 Regen for fstatfs. 2009-06-05 16:46:52 +00:00
njoly ca080002aa Add fstatfs syscall. 2009-06-05 16:45:33 +00:00
njoly 4c8893bb2f Regen for stat/lstat/fstat syscalls. 2009-06-04 18:01:02 +00:00
njoly 33fdfb68ef Add stat/lstat/fstat syscalls. 2009-06-04 17:59:30 +00:00
njoly 49c8536f1f Regen for siggetmask/sigsetmask. 2009-06-02 16:55:16 +00:00
njoly 9a0f18cccc Add siggetmask/sigsetmask syscalls. 2009-06-02 16:54:39 +00:00
njoly d22e6f64ab Add native to linux siginfo si_status translation, used on i386 and
amd64.
2009-05-29 14:19:12 +00:00
cegger 9fca5da616 ansify function definitions 2009-03-15 15:55:51 +00:00
njoly bc0bccb487 Regen for mincore(2). 2009-01-30 13:57:39 +00:00
njoly 8bbb521068 Add mincore syscall. 2009-01-30 13:55:51 +00:00
njoly 8ed9e9eb51 Regen for personality(2) addition. 2009-01-20 12:02:09 +00:00
njoly b22c955a54 Add basic support for linux32 personality(2) syscall. 2009-01-20 12:00:58 +00:00
njoly 77237e1c08 Regen for wait4 update. 2009-01-17 22:34:02 +00:00
njoly 25a76c08aa Convert linux/linux32 wait(4) to use a compat50 rusage structure. 2009-01-17 22:28:52 +00:00
njoly 8ff5603c09 Regen for compat 50 update. 2009-01-16 13:12:35 +00:00
njoly 9554a2932f Update some syscalls that now needs compat50 timeval structure. 2009-01-16 13:10:47 +00:00
pooka 5d19acad62 Regen to prove I didn't screw up the conversion: purely RCSID changes. 2009-01-13 22:33:08 +00:00
pooka a9a2ce837b Convert the syscalls.master to a format from which it is easier
to parse and generate the compat name and basename (e.g. __stat50
and stat).  Use this to autogenerate __RENAME()'s to the rump_syscalls
header so that they can be called e.g. rump_sys_socket() instead
of rump_sys___socket30().
2009-01-13 22:27:43 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
njoly 6b9fe0233d Regen for clock_nanosleep. 2008-12-12 23:38:13 +00:00
njoly 99688b74d2 Add clock_nanosleep syscall. 2008-12-12 23:36:18 +00:00
njoly adf5b0a542 Regen for netbsd32_caddr_t removal. 2008-12-06 23:15:09 +00:00
njoly e7377ec502 Cleanup; kill netbsd32_caddr_t use. 2008-12-06 23:14:03 +00:00