summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Start each of the license/copyright comments with /*-imp2005-01-0567-67/+67
|
* - Move the function prototypes for kern_setrlimit() and kern_wait() tojhb2005-01-052-0/+2
| | | | | sys/syscallsubr.h where all the other kern_foo() prototypes live. - Resort kern_execve() while I'm there.
* Regenerate.jhb2005-01-044-13/+15
|
* Partial sync up to the master syscalls.master file:jhb2005-01-041-8/+9
| | | | | | | | - Mark mount, unmount and nmount MPSAFE. - Add a stub for _umtx_op(). - Mark open(), link(), unlink(), and freebsd32_sigaction() MPSAFE. Pointy hats to: several
* Stop explicitly touching td_base_pri outside of the scheduler and simplyjhb2004-12-301-2/+0
| | | | | set a thread's priority via sched_prio() when that is the desired action. The schedulers will start managing td_base_pri internally shortly.
* Do not blindly pass linux filesystem specific mount data across.phk2004-12-031-1/+1
|
* Fix unvalidated pointer dereference. This is FreeBSD-SA-04:17.procfs.cperciva2004-12-011-1/+13
|
* Don't include sys/user.h merely for its side-effect of recursivelydas2004-11-272-3/+1
| | | | including other headers.
* Axe the semblance of support for PECOFF and Linux a.out core dumps.das2004-11-271-67/+1
|
* Ignore MNT_NODEV option, it is implicit in choice of filesystem.phk2004-11-261-2/+0
|
* Maintain the broken state of backwards compatibilty for a.out (anddas2004-11-201-2/+3
| | | | | | | PECOFF!) core dumps. None of the old versions of gdb I tried were able to read a.out core dumps before or after this change. Reviewed by: arch@
* Rebuild from compat/freebsd32/syscalls.master:1.43marks2004-11-182-2/+2
| | | | | Reviewed by: imp, phk, njl, peter Approved by: njl
* 32-bit FreeBSD ABI compatibility stubs from syscalls.master:1.179marks2004-11-181-1/+1
| | | | | Reviewed by: imp, phk, njl, peter Approved by: njl
* Introduce an alias for FILEDESC_{UN}LOCK() with the suffix _FAST.phk2004-11-132-6/+6
| | | | | | | | Use this in all the places where sleeping with the lock held is not an issue. The distinction will become significant once we finalize the exact lock-type to use for this kind of case.
* Pick up the inode number using VOP_GETATTR() rather than caching itphk2004-11-101-4/+6
| | | | | in all vnodes on the off chance that linprocfs needs it. If we can afford to call vn_fullpath() we can afford the much cheaper VOP_GETATTR().
* More sensible FILEDESC_ locking.phk2004-11-071-3/+2
|
* Rebuild from FreeBSD32 syscalls.master:1.42.rwatson2004-10-234-5/+23
|
* 32-bit FreeBSD ABI compatibility stubs from syscalls.master:1.178.rwatson2004-10-231-0/+9
|
* Put on my peril sensitive sunglasses and add a flags field to the internalpeter2004-10-111-7/+3
| | | | | | | | | | | | | | | | sysctl routines and state. Add some code to use it for signalling the need to downconvert a data structure to 32 bits on a 64 bit OS when requested by a 32 bit app. I tried to do this in a generic abi wrapper that intercepted the sysctl oid's, or looked up the format string etc, but it was a real can of worms that turned into a fragile mess before I even got it partially working. With this, we can now run 'sysctl -a' on a 32 bit sysctl binary and have it not abort. Things like netstat, ps, etc have a long way to go. This also fixes a bug in the kern.ps_strings and kern.usrstack hacks. These do matter very much because they are used by libc_r and other things.
* Rename thread args to be called "td" rather than "p" to bedwmalone2004-10-101-6/+6
| | | | | | | | consistent with other bits of this file. There should be no functional change. Submitted by: Andrea Campi (many moons ago) MFC after: 2 month
* Close a race between a thread exiting and the freeing of it's stack.mtm2004-10-065-6/+6
| | | | | | | | | After some discussion the best option seems to be to signal the thread's death from within the kernel. This requires that thr_exit() take an argument. Discussed with: davidxu, deischen, marcel MFC after: 3 days
* Rework how we store process times in the kernel such that we always storejhb2004-10-053-71/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the raw values including for child process statistics and only compute the system and user timevals on demand. - Fix the various kern_wait() syscall wrappers to only pass in a rusage pointer if they are going to use the result. - Add a kern_getrusage() function for the ABI syscalls to use so that they don't have to play stackgap games to call getrusage(). - Fix the svr4_sys_times() syscall to just call calcru() to calculate the times it needs rather than calling getrusage() twice with associated stackgap, etc. - Add a new rusage_ext structure to store raw time stats such as tick counts for user, system, and interrupt time as well as a bintime of the total runtime. A new p_rux field in struct proc replaces the same inline fields from struct proc (i.e. p_[isu]ticks, p_[isu]u, and p_runtime). A new p_crux field in struct proc contains the "raw" child time usage statistics. ruadd() has been changed to handle adding the associated rusage_ext structures as well as the values in rusage. Effectively, the values in rusage_ext replace the ru_utime and ru_stime values in struct rusage. These two fields in struct rusage are no longer used in the kernel. - calcru() has been split into a static worker function calcru1() that calculates appropriate timevals for user and system time as well as updating the rux_[isu]u fields of a passed in rusage_ext structure. calcru() uses a copy of the process' p_rux structure to compute the timevals after updating the runtime appropriately if any of the threads in that process are currently executing. It also now only locks sched_lock internally while doing the rux_runtime fixup. calcru() now only requires the caller to hold the proc lock and calcru1() only requires the proc lock internally. calcru() also no longer allows callers to ask for an interrupt timeval since none of them actually did. - calcru() now correctly handles threads executing on other CPUs. - A new calccru() function computes the child system and user timevals by calling calcru1() on p_crux. Note that this means that any code that wants child times must now call this function rather than reading from p_cru directly. This function also requires the proc lock. - This finishes the locking for rusage and friends so some of the Giant locks in exit1() and kern_wait() are now gone. - The locking in ttyinfo() has been tweaked so that a shared lock of the proctree lock is used to protect the process group rather than the process group lock. By holding this lock until the end of the function we now ensure that the process/thread that we pick to dump info about will no longer vanish while we are trying to output its info to the console. Submitted by: bde (mostly) MFC after: 1 month
* Add a proc *p pointer for td->td_proc to make this code easier to read.jhb2004-09-241-8/+8
|
* Hold thread reference while frobbing cdevsw.phk2004-09-241-18/+24
|
* Various small style fixes.jhb2004-09-221-1/+1
|
* Fix compiler warnings, when __stdcall is #defined, by adding explicit casts.bms2004-09-172-2/+2
| | | | | | | | | | These normally only manifest if the ndis compat module is statically compiled into a kernel image by way of 'options NDISAPI'. Submitted by: Dmitri Nikulin Approved by: wpaul PR: kern/71449 MFC after: 1 week
* Regenerate after fcntl() wrappers were marked MP safe.jhb2004-08-244-5/+5
|
* Fix the ABI wrappers to use kern_fcntl() rather than calling fcntl()jhb2004-08-244-88/+56
| | | | | | | | directly. This removes a few more users of the stackgap and also marks the syscalls using these wrappers MP safe where appropriate. Tested on: i386 with linux acroread5 Compiled on: i386, alpha LINT
* Don't try to translate the control message unless we're certain it'sdes2004-08-231-1/+2
| | | | | | | | valid; otherwise a caller could trick us into changing any 32-bit word in kernel memory to LINUX_SOL_SOCKET (0x00000001) if its previous value is SOL_SOCKET (0x0000ffff). MFC after: 3 days
* I'm a dumbass: remember to initialize fh->nf_map to NULL inwpaul2004-08-161-0/+1
| | | | ndis_open_file() in the module loading case.
* The Texas Instruments ACX111 driver wants srand(), so provide it.wpaul2004-08-161-0/+10
|
* Make the Texas Instruments 802.11g chipset work with the NDISulator.wpaul2004-08-163-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was tested with a Netgear WG311v2 802.11b/g PCI card. Things that were fixed: - This chip has two memory mapped regions, one at PCIR_BAR(0) and the other at PCIR_BAR(1). This is a little different from the other chips I've seen with two PCI shared memory regions, since they tend to have the second BAR ad PCIR_BAR(2). if_ndis_pci.c tests explicitly for PCIR_BAR(2). This has been changed to simply fill in ndis_res_mem first and ndis_res_altmem second, if a second shared memory range exists. Given that NDIS drivers seem to scan for BARs in ascending order, I think this should be ok. - Fixed the code that tries to process firmware images that have been loaded as .ko files. To save a step, I was setting up the address mapping in ndis_open_file(), but ndis_map_file() flags pre-existing mappings as an error (to avoid duplicate mappings). Changed this so that the mapping is now donw in ndis_map_file() as expected. - Made the typedef for 'driver_entry' explicitly include __stdcall to silence gcc warning in ndis_load_driver(). NOTE: the Texas Instruments ACX111 driver needs firmware. With my card, there were 3 .bin files shipped with the driver. You must either put these files in /compat/ndis or convert them with ndiscvt -f and kldload them so the driver can use them. Without the firmware image, the NIC won't work.
* Fix the 'DEBUG' argument code to unbreak the amd64 LINT build.obrien2004-08-161-1/+1
|
* Fix the 'DEBUG' argument code to unbreak the amd64 LINT build.obrien2004-08-161-2/+2
|
* Fix the 'DEBUG' argument code to unbreak the LINT build.obrien2004-08-161-2/+2
|
* Add support for 32-bit Linux binary emulation on amd64:tjr2004-08-161-5/+16
| | | | | | | - include <machine/../linux32/linux.h> instead of <machine/../linux/linux.h> if building with the COMPAT_LINUX32 option. - make minimal changes to the i386 linprocfs_docpuinfo() function to support amd64. We return a fake CPU family of 6 for now.
* Changes to MI Linux emulation code necessary to run 32-bit Linux binariestjr2004-08-1612-112/+244
| | | | | | | | | | | | | | | on AMD64, and the general case where the emulated platform has different size pointers than we use natively: - declare certain structure members as l_uintptr_t and use the new PTRIN and PTROUT macros to convert to and from native pointers. - declare some structures __packed on amd64 when the layout would differ from that used on i386. - include <machine/../linux32/linux.h> instead of <machine/../linux/linux.h> if compiling with COMPAT_LINUX32. This will need to be revisited before 32-bit and 64-bit Linux emulation support can coexist in the same kernel. - other small scattered changes. This should be a no-op on i386 and Alpha.
* Replace linux_getitimer() and linux_setitimer() with implementationstjr2004-08-151-24/+77
| | | | | based on those in freebsd32_misc.c, removing the assumption that Linux uses the same layout for struct itimerval as we use natively.
* Avoid assuming that l_timeval is the same as the native struct timevaltjr2004-08-151-2/+7
| | | | in linux_select().
* Use sv_psstrings from the current process's sysentvec structure insteadtjr2004-08-151-2/+3
| | | | | | of PS_STRINGS. This is a no-op at present, but it will be needed when running 32-bit Linux binaries on amd64 to ensure PS_STRINGS is in addressable memory.
* Add XXX comment about findcdev() misuse.phk2004-08-141-0/+6
|
* Add __elfN(dump_thread). This function is called from __elfN(coredump)marcel2004-08-111-0/+8
| | | | | | | | | to allow dumping per-thread machine specific notes. On ia64 we use this function to flush the dirty registers onto the backingstore before we write out the PRSTATUS notes. Tested on: alpha, amd64, i386, ia64 & sparc64 Not tested on: arm, powerpc
* More minor cleanups and one small bug fix:wpaul2004-08-044-36/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | - In ntoskrnl_var.h, I had defined compat macros for ntoskrnl_acquire_spinlock() and ntoskrnl_release_spinlock() but never used them. This is fortunate since they were stale. Fix them to work properly. (In Windows/x86 KeAcquireSpinLock() is a macro that calls KefAcquireSpinLock(), which lives in HAL.dll. To imitate this, ntoskrnl_acquire_spinlock() is just a macro that calls hal_lock(), which lives in subr_hal.o.) - Add macros for ntoskrnl_raise_irql() and ntoskrnl_lower_irql() that call hal_raise_irql() and hal_lower_irql(). - Use these macros in kern_ndis.c, subr_ndis.c and subr_ntoskrnl.c. - Along the way, I realised subr_ndis.c:ndis_lock() was not calling hal_lock() correctly (it was using the FASTCALL2() wrapper when in reality this routine is FASTCALL1()). Using the ntoskrnl_acquire_spinlock() fixes this. Not sure if this actually caused any bugs since hal_lock() would have just ignored what was in %edx, but it was still bogus. This hides many of the uses of the FASTCALLx() macros which makes the code a little cleaner. Should not have any effect on generated object code, other than the one fix in ndis_lock().
* In ndis_alloc_bufpool() and ndis_alloc_packetpool(), the test to see ifwpaul2004-08-011-2/+2
| | | | | allocating pool memory succeeded was checking the wrong pointer (should have been looking at *pool, not pool). Corrected this.
* Big mess 'o changes:wpaul2004-08-018-146/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Give ndiscvt(8) the ability to process a .SYS file directly into a .o file so that we don't have to emit big messy char arrays into the ndis_driver_data.h file. This behavior is currently optional, but may become the default some day. - Give ndiscvt(8) the ability to turn arbitrary files into .ko files so that they can be pre-loaded or kldloaded. (Both this and the previous change involve using objcopy(1)). - Give NdisOpenFile() the ability to 'read' files out of kernel memory that have been kldloaded or pre-loaded, and disallow the use of the normal vn_open() file opening method during bootstrap (when no filesystems have been mounted yet). Some people have reported that kldloading if_ndis.ko works fine when the system is running multiuser but causes a panic when the modile is pre-loaded by /boot/loader. This happens with drivers that need to use NdisOpenFile() to access external files (i.e. firmware images). NdisOpenFile() won't work during kernel bootstrapping because no filesystems have been mounted. To get around this, you can now do the following: o Say you have a firmware file called firmware.img o Do: ndiscvt -f firmware.img -- this creates firmware.img.ko o Put the firmware.img.ko in /boot/kernel o add firmware.img_load="YES" in /boot/loader.conf o add if_ndis_load="YES" and ndis_load="YES" as well Now the loader will suck the additional file into memory as a .ko. The phony .ko has two symbols in it: filename_start and filename_end, which are generated by objcopy(1). ndis_open_file() will traverse each module in the module list looking for these symbols and, if it finds them, it'll use them to generate the file mapping address and length values that the caller of NdisOpenFile() wants. As a bonus, this will even work if the file has been statically linked into the kernel itself, since the "kernel" module is searched too. (ndiscvt(8) will generate both filename.o and filename.ko for you). - Modify the mechanism used to provide make-pretend FASTCALL support. Rather than using inline assembly to yank the first two arguments out of %ecx and %edx, we now use the __regparm__(3) attribute (and the __stdcall__ attribute) and use some macro magic to re-order the arguments and provide dummy arguments as needed so that the arguments passed in registers end up in the right place. Change taken from DragonflyBSD version of the NDISulator.
* Use kernel_vmount() instead of vfs_nmount().phk2004-07-271-15/+4
|
* Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL. This iscperciva2004-07-262-2/+2
| | | | | | | | | | | somewhat clearer, but more importantly allows for a consistent naming scheme for suser_cred flags. The old name is still defined, but will be removed in a few days (unless I hear any complaints...) Discussed with: rwatson, scottl Requested by: jhb
* *sigh* Fix source code compatibility with 5.2.1-RELEASE _again_.wpaul2004-07-201-0/+6
| | | | (Make kdb stuff conditional.)
* I missed two pieces of the commit to this file. Robert has alreadydwmalone2004-07-181-1/+1
| | | | added one, this adds the other.
* Remove 'sg' argument to linux_sendto_hdrincl, which is what I think wasrwatson2004-07-181-1/+1
| | | | intended. This fixes the build, but might require revision.
OpenPOWER on IntegriCloud