summaryrefslogtreecommitdiffstats
path: root/sys/amd64/linux32
Commit message (Collapse)AuthorAgeFilesLines
* Adapt linux emulation to use cv for vfork wait.kib2009-02-181-2/+2
| | | | | Submitted by: Takahiro Kurosawa <takahiro.kurosawa gmail com> PR: kern/131506
* Fix the inconsistent tabbing.obrien2009-01-311-52/+55
| | | | Noticed by: bde
* Change some movl's to mov's. Newer GAS no longer accept 'movl' instructionsobrien2009-01-312-8/+8
| | | | | | for moving between a segment register and a 32-bit memory location. Looked at by: jhb
* Remove obsolete AT_DEBUG stuff. It never should have been committedimp2008-12-171-2/+0
| | | | | | in the first place, let alone migrated to linux emulation. Reviewed by: peter, rdivacky
* Make linux_sendmsg() and linux_recvmsg() work on linux32/amd64.kib2008-11-291-0/+16
| | | | | | | | Change types used in the linux' struct msghdr and struct cmsghdr definitions to the properly-sized architecture-specific types. Move ancillary data handler from linux_sendit() to linux_sendmsg(). Submitted by: dchagin
* Regeneratekib2008-11-293-9/+9
|
* Fix iovec32 for linux32/amd64.kib2008-11-293-14/+47
| | | | | | | | | | | Add a custom version of copyiniov() to deal with the 32-bit iovec pointers from userland (to be used later). Adjust prototypes for linux_readv() and linux_writev() to use new l_iovec32 definition and to match actual linux code. In particular, use ulong for fd (why ?). Submitted by: dchagin
* Add sv_flags field to struct sysentvec with intention to provide descriptionkib2008-11-221-0/+1
| | | | | | | | of the ABI of the currently executing image. Change some places to test the flags instead of explicit comparing with address of known sysentvec structures to determine ABI features. Discussed with: dchagin, imp, jhb, peter
* In the robust futexes list head, futex_offset shall be signed,kib2008-11-161-1/+1
| | | | | | and glibc actually supplies negative offsets. Change l_ulong to l_long. Submitted by: dchagin
* Several cleanups related to pipe(2).ed2008-11-111-18/+5
| | | | | | | | | | | | | | | | | | - Use `fildes[2]' instead of `*fildes' to make more clear that pipe(2) fills an array with two descriptors. - Remove EFAULT from the manual page. Because of the current calling convention, pipe(2) raises a segmentation fault when an invalid address is passed. - Introduce kern_pipe() to make it easier for binary emulations to implement pipe(2). - Make Linux binary emulation use kern_pipe(), which means we don't have to recover td_retval after calling the FreeBSD system call. Approved by: rdivacky Discussed on: arch
* Regenerate system call tables for r184789.ed2008-11-093-5/+11
|
* Mark uname(), getdomainname() and setdomainname() with COMPAT_FREEBSD4.ed2008-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | Looking at our source code history, it seems the uname(), getdomainname() and setdomainname() system calls got deprecated somewhere after FreeBSD 1.1, but they have never been phased out properly. Because we don't have a COMPAT_FREEBSD1, just use COMPAT_FREEBSD4. Also fix the Linuxolator to build without the setdomainname() routine by just making it call userland_sysctl on kern.domainname. Also replace the setdomainname()'s implementation to use this approach, because we're duplicating code with sysctl_domainname(). I wasn't able to keep these three routines working in our COMPAT_FREEBSD32, because that would require yet another keyword for syscalls.master (COMPAT4+NOPROTO). Because this routine is probably unused already, this won't be a problem in practice. If it turns out to be a problem, we'll just restore this functionality. Reviewed by: rdivacky, kib
* Correctly fill siginfo for the signals delivered by linux tkill/tgkill.kib2008-10-192-15/+18
| | | | | | | | | | | | | | | | | | | | | It is required for async cancellation to work. Fix PROC_LOCK leak in linux_tgkill when signal delivery attempt is made to not linux process. Do not call em_find(p, ...) with p unlocked. Move common code for linux_tkill() and linux_tgkill() into linux_do_tkill(). Change linux siginfo_t definition to match actual linux one. Extend uid fields to 4 bytes from 2. The extension does not change structure layout and is binary compatible with previous definition, because i386 is little endian, and each uid field has 2 byte padding after it. Reported by: Nicolas Joly <njoly pasteur fr> Submitted by: dchangin MFC after: 1 month
* Set PCB_32BIT and clear PCB_GS32BIT for linux32 binaries.kib2008-10-181-1/+2
| | | | | Tested by: dchagin MFC after: 3 days
* Make robust futexes work on linux32/amd64. Use PTRIN to readkib2008-10-141-0/+11
| | | | | | | | user-mode pointers. Change types used in the structures definitions to properly-sized architecture-specific types. Submitted by: dchagin MFC after: 1 week
* Change the static struct sysentvec and struct Elf_Brandinfo initializerskib2008-09-241-49/+49
| | | | | | | | | | | to the C99 style. At least, it is easier to read sysent definitions that way, and search for the actual instances of sigcode etc. Explicitely initialize sysentvec.sv_maxssiz that was missed in most sysvecs. No objection from: jhb MFC after: 1 month
* The pcb_gs32p should be per-cpu, not per-thread pointer. This iskib2008-09-081-3/+1
| | | | | | | | location in GDT where the segment descriptor from pcb_gs32sd is copied, and the location is in GDT local to CPU. Noted and reviewed by: peter MFC after: 1 week
* In linux_set_thread_area(), mark pcb as PCB_GS32BIT. This was missedkib2008-09-081-1/+1
| | | | | | | when r180992 was committed. Reviewed by: peter MFC after: 1 week
* Segment registers are stored in the uc_mcontext member of the structkib2008-09-072-4/+4
| | | | | | | | | l_ucontext. To restore the registers content, trampoline needs to dereference uc_mcontext instead of taking some undefined values from l_ucontext. Submitted by: Dmitry Chagin <dchagin@> MFC after: 1 week
* Bring back the save/restore of the %ds, %es, %fs and %gs registers forkib2008-07-301-1/+1
| | | | | | | | | | | | | | | the 32bit images on amd64. Change the semantic of the PCB_32BIT pcb flag to request the context switch code to operate on the segment registers. Its previous meaning of saving or restoring the %gs base offset is assigned to the new PCB_GS32BIT flag. FreeBSD 32bit image activator sets the PCB_32BIT flag, while Linux 32bit emulation sets PCB_32BIT | PCB_GS32BIT. Reviewed by: peter MFC after: 2 weeks
* Regen.rdivacky2008-05-133-7/+10
| | | | Approved by: kib (mentor)
* Implement robust futexes. Most of the code is modelled afterrdivacky2008-05-132-4/+4
| | | | | | | | | | | what Linux does. This is because robust futexes are mostly userspace thing which we cannot alter. Two syscalls maintain pointer to userspace list and when process exits a routine walks this list waking up processes sleeping on futexes from that list. Reviewed by: kib (mentor) MFC after: 1 month
* Implement linux_truncate64() syscall.rdivacky2008-04-231-1/+0
| | | | | Tested by: Aline de Freitas <aline@riseup.net> Approved by: kib (mentor)
* Regenerate.jkim2008-04-163-4/+46
|
* Add stubs for syscalls introduced in Linux 2.6.17 kernel.jkim2008-04-162-0/+12
| | | | | | Some GNU libc version started using them before 2.6.17 was officially out. MFC after: 3 days
* Regeneratekib2008-04-083-41/+73
|
* Implement the linux syscallskib2008-04-084-28/+26
| | | | | | | | | openat, mkdirat, mknodat, fchownat, futimesat, fstatat, unlinkat, renameat, linkat, symlinkat, readlinkat, fchmodat, faccessat. Submitted by: rdivacky Sponsored by: Google Summer of Code 2007 Tested by: pho
* Regen.rdivacky2008-03-163-4/+12
|
* Implement sched_setaffinity and get_setaffinity usingrdivacky2008-03-161-1/+2
| | | | | | | real cpu affinity setting primitives. Reviewed by: jeff Approved by: kib (mentor)
* Since version 4.3, gcc changed its behaviour concerning the i386/amd64kib2008-03-131-2/+2
| | | | | | | | | | | | | | | | | | ABI and the direction flag, that is it now assumes that the direction flag is cleared at the entry of a function and it doesn't clear once more if needed. This new behaviour conforms to the i386/amd64 ABI. Modify the signal handler frame setup code to clear the DF {e,r}flags bit on the amd64/i386 for the signal handlers. jhb@ noted that it might break old apps if they assumed DF == 1 would be preserved in the signal handlers, but that such apps should be rare and that older versions of gcc would not generate such apps. Submitted by: Aurelien Jarno <aurelien aurel32 net> PR: 121422 Reviewed by: jhb MFC after: 2 weeks
* Remove kernel support for M:N threading.jeff2008-03-121-2/+1
| | | | | | | | While the KSE project was quite successful in bringing threading to FreeBSD, the M:N approach taken by the kse library was never developed to its full potential. Backwards compatibility will be provided via libmap.conf for dynamically linked binaries and static binaries will be broken.
* Fix Linux mmap with MAP_GROWSDOWN flag.jkim2008-02-111-13/+14
| | | | | | | Reported by: Andriy Gapon (avg at icyb dot net dot ua) Tested by: Andriy Gapon (avg at icyb dot net dot ua) Pointyhat: me MFC after: 3 days
* Fill in cr2 in the signal context from ksi->ksi_addr.kib2007-09-201-0/+2
| | | | | | | | | | Together with the sys/i386/i386/trap.c rev. 1.306 it fixes the PR. Submitted by: rdivacky Suggested by: jhb Sponsored by: Google Summer of Code 2007 PR: kern/77710 Approved by: re (kensmith)
* The kernel version of Linux statfs64 is actually supposed to takedwmalone2007-09-183-1/+15
| | | | | | | | | | | | | 3 arguments, but we had forgotten the second argument. Also make the Linux statfs64 struct depend on the architecture because it has an extra 4 bytes padding on amd64 compared to i386. The three argument fix is from David Taylor, the struct statfs64 stuff is my fault. With this patch I can install i386 Linux matlab on an amd64 machine. Submitted by: David Taylor <davidt_at_yadt.co.uk> Approved by: re (kensmith)
* Regenerate.kib2007-08-283-4/+19
| | | | Approved by: re (kensmith)
* Implement fake linux sched_getaffinity() syscall to enable java to workkib2007-08-281-1/+2
| | | | | | | | | | with Linux 2.6 emulation. This shall be reimplemented once FreeBSD gets native scheduler affinity syscalls. Submitted by: rdivacky Reviewed by: jkim Sponsored by: Google Summer of Code 2007 Approved by: re (kensmith)
* Fix a couple of issues with the stack limit for 32-bit processes on 64-bitjhb2007-07-121-1/+2
| | | | | | | | | | | | | kernels exposed by the recent fixes to resource limits for 32-bit processes on 64-bit kernels: - Let ABIs expose their maximum stack size via a new pointer in sysentvec and use that in preference to maxssiz during exec() rather than always using maxssiz for all processses. - Apply the ABI's limit fixup to the previous stack size when adjusting RLIMIT_STACK to determine if the existing mapping for the stack needs to be grown or shrunk (as well as how much it should be grown or shrunk). Approved by: re (kensmith)
* Don't add the 'pad' argument to the mmap/truncate/etc syscalls.peter2007-07-041-2/+0
| | | | | Submitted by: kensmith Approved by: re (kensmith)
* Commit 14/14 of sched_lock decomposition.jeff2007-06-051-6/+6
| | | | | | | | | | | - Use thread_lock() rather than sched_lock for per-thread scheduling sychronization. - Use the per-process spinlock rather than the sched_lock for per-process scheduling synchronization. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
* Move futex support code from <arch>/support.s into linux compat directory.kib2007-05-231-0/+124
| | | | | | | | | | Implement all futex atomic operations in assembler to not depend on the fuword() that does not allow to distinguish between -1 and failure return. Correctly return 0 from atomic operations on success. In collaboration with: rdivacky Tested by: Scot Hetzel <swhetzel gmail com>, Milos Vyletel <mvyletel mzm cz> Sponsored by: Google SoC 2007
* Rework the support for ABIs to override resource limits (used by 32-bitjhb2007-05-141-34/+28
| | | | | | | | | | | | | | | | | | | processes under 64-bit kernels). Previously, each 32-bit process overwrote its resource limits at exec() time. The problem with this approach is that the new limits affect all child processes of the 32-bit process, including if the child process forks and execs a 64-bit process. To fix this, don't ovewrite the resource limits during exec(). Instead, sv_fixlimits() is now replaced with a different function sv_fixlimit() which asks the ABI to sanitize a single resource limit. We then use this when querying and setting resource limits. Thus, if a 32-bit process sets a limit, then that new limit will be inherited by future children. However, if the 32-bit process doesn't change a limit, then a future 64-bit child will see the "full" 64-bit limit rather than the 32-bit limit. MFC is tentative since it will break the ABI of old linux.ko modules (no other modules are affected). MFC after: 1 week
* Do not dereference linux_to_bsd_signal[-1] if userland haskan2007-05-111-4/+5
| | | | | | | | passed zero as exit signal. GCC 4.2 changes the kernel data segment layout not to have 0 in that memory location. This code ran by luck before and now the luck has run out.
* Fix style(9) and comments.jkim2007-04-181-12/+16
| | | | Submitted by: Scot Hetzel (swhetzel at gmail dot com)
* style(9) says sizeof's are not be followed by a space. Fix them.jkim2007-04-181-3/+3
|
* Implement settimeofday() for Linuxulator/amd64.jkim2007-04-182-1/+27
| | | | Submitted by: Scot Hetzel (swhetzel at gmail dot com)
* MFP4: Turn emul_lock into a mutex.jkim2007-04-021-2/+2
| | | | Submitted by: rdivacky
* MFP4: Fix style(9) nits and grammar in comments.jkim2007-03-301-49/+48
|
* MFP4: 114193, 114194jkim2007-03-301-11/+11
| | | | | | | Dont "return" in linux_clone() after we forked the new process in a case of problems. Move the copyout of p2->p_pid outside the emul_lock coverage. Submitted by: Roman Divacky
* Regen for set_thread_area.jkim2007-03-303-4/+10
|
* MFP4: Linux set_thread_area syscall (aka TLS) support for amd64.jkim2007-03-304-16/+158
| | | | | | Initial version was submitted by Divacky Roman and mostly rewritten by me. Tested by: emulation
OpenPOWER on IntegriCloud