summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_misc.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Let newuname return "Linux" as the OS name and not "FreeBSD". Also, return amarcel1999-07-051-3/+3
| | | | | more sensible (for Linux applications) release number. Hardcoding a release number has its drawbacks, but it will do for now.
* Fix up a few easy 'assignment used as truth value' and 'suggest parenspeter1999-05-061-7/+13
| | | | | around && within ||' type warnings. I'm pretty sure I have not masked any problems here, I've committed real problem fixes seperately.
* Enable vmspace sharing on SMP. Major changes are,luoqi1999-04-281-9/+5
| | | | | | | | | | | | | | | | | - %fs register is added to trapframe and saved/restored upon kernel entry/exit. - Per-cpu pages are no longer mapped at the same virtual address. - Each cpu now has a separate gdt selector table. A new segment selector is added to point to per-cpu pages, per-cpu global variables are now accessed through this new selector (%fs). The selectors in gdt table are rearranged for cache line optimization. - fask_vfork is now on as default for both UP and SMP. - Some aio code cleanup. Reviewed by: Alan Cox <alc@cs.rice.edu> John Dyson <dyson@iquest.net> Julian Elischer <julian@whistel.com> Bruce Evans <bde@zeta.org.au> David Greenman <dg@root.com>
* Change suser_xxx() to suser() where it applies.phk1999-04-271-2/+2
|
* Suser() simplification:phk1999-04-271-3/+3
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* unifdef -DVM_STACK - it's been on for a while for x86 and was checkedpeter1999-04-191-14/+1
| | | | and appeared to be working for the Alpha some time ago.
* Fix thread/process tracking and differentiation for Linux threads emulation.julian1999-03-021-19/+16
| | | | | | Submitted by: Richard Seaman, Jr." <dick@tar.com> Also clean some compiler warnings in surrounding code.
* Enable Linux threads support by default.julian1999-01-261-33/+3
| | | | | | | | | This takes the conditionals out of the code that has been tested by various people for a while. ps and friends (libkvm) will need a recompile as some proc structure changes are made. Submitted by: "Richard Seaman, Jr." <dick@tar.com>
* Add (but don't activate) code for a special VM option to makejulian1999-01-061-47/+46
| | | | | | | | | | | | | downward growing stacks more general. Add (but don't activate) code to use the new stack facility when running threads, (specifically the linux threads support). This allows people to use both linux compiled linuxthreads, and also the native FreeBSD linux-threads port. The code is conditional on VM_STACK. Not using this will produce the old heavily tested system. Submitted by: Richard Seaman <dick@tar.com>
* Commit #2 ofsos1998-12-301-1/+73
| | | | | PR: 9235 Submitted by: marcel@scc.nl <Marcel Moolenaar>
* According to the author..julian1998-12-241-9/+4
| | | | | | | | | | | | | | | | | | "I've been having a problem running the patches [committed to current] installed with the COMPAT_LINUX_THREADS option along with the VM_STACK patches I did. I'm not sure what the problem is, since it seemed to work before. In any event, the attached patch fixes the problem for me. While I've had no report of problems from anyone else, possibly it would be wise to commit the patch until the problem is found. Also, there was some left-over junk in the linux_misc.c file from some earlier work I did. The attached patch cleans that up too." Submitted by: "Richard Seaman, Jr." <dick@tar.com>
* Reviewed by: Luoqi Chen, Jordan Hubbardjulian1998-12-191-1/+173
| | | | | | | | | | | | Submitted by: "Richard Seaman, Jr." <lists@tar.com> Obtained from: linux :-) Code to allow Linux Threads to run under FreeBSD. By default not enabled This code is dependent on the conditional COMPAT_LINUX_THREADS (suggested by Garret) This is not yet a 'real' option but will be within some number of hours.
* linux_pipe does not preserve the edx register. Linux andjkh1998-12-101-3/+12
| | | | | | | | | programs using glibc expect edx to be preserved accross syscalls. As a result, linux programs running in emulation mode can have whatever value may be represented by edx clobbered. PR: 9038 Submitted-By: Richard Seaman, Jr. <dick@tar.com>
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-7/+13
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* In linux_newuname bzero the right type of struct (linux_newuname_t).sos1998-10-051-2/+2
|
* MF22: revert time bogon.jkh1998-09-241-2/+1
|
* return time in proper format for linux.jkh1998-09-231-1/+2
|
* Use [u]intptr_t instead of [u_]long for casts between pointers andbde1998-08-161-3/+3
| | | | integers. Don't forget to cast to (void *) as well.
* Converted the second last instance of hzto() to tvtohz().bde1998-08-051-20/+15
| | | | | | | | | | | | | | | | | Fixed nearby bugs (in linux_alarm()): - the itimer for the alarm was relative to the epoch instead of relative to the boot time. This was harmless because the itimer's interval is 0. - the seconds arg was not checked for validity before converting it to a possibly different value. - printf format errors. Improvements: Don't use splclock(). splsoftclock() suffices. Don't complicate things by micro-optimizing interrupt latency. Minor improvements: Various micro-optimizations to exploit the specialness of the alarm itimer and the value 0.
* Fixed print format errors.bde1998-07-291-26/+31
|
* Quick and dirty support for Linux's mremap. Not used by anythingjkh1998-07-101-1/+32
| | | | | | but quake2 AFAIK. Submitted by: Luoqi Chen <luoqi@watermarkgroup.com>
* s/nanoruntime/nanouptime/gphk1998-05-171-2/+2
| | | | | | s/microruntime/microuptime/g Reviewed by: bde
* Make a kernel version of the timer* functions called timerval* to bephk1998-04-061-9/+9
| | | | | | more consistent. OK'ed by: bde
* Use microruntime() rather than doing it by hand.phk1998-04-041-3/+2
|
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* Removed redundant test against MAXDSIZ (the rlimit test is stronger).bde1998-02-251-3/+3
|
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-53/+52
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Securelevel and formatting fixes, and trapframe simplification.kato1997-10-301-10/+9
| | | | | Reviewed by: sos Submitted by: bde
* Implement linux_iopl and linux_nice.kato1997-10-291-1/+31
|
* Update for changes in the callout interface.gibbs1997-09-211-3/+4
|
* Removed unused #includes.bde1997-07-201-8/+1
|
* Always include PROT_READ for Linux mmap operations.msmith1997-04-281-2/+2
| | | | Submitted by: Hannu Savolainen <hannu@voxware.pp.fi> via jkh
* Removed potentially harmful garbage <vm/lock.h> and fixed bogusbde1997-04-011-2/+1
| | | | | | use of it. It was actually harmless because the use was null due to fortuitous include orders and identical (wrong) idempotency macros.
* Don't include <sys/ioctl.h> in the kernel. Stage 1: don't includebde1997-03-241-2/+1
| | | | | it when it is not used. In most cases, the reasons for including it went away when the special ioctl headers became self-sufficient.
* Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.bde1997-03-231-2/+2
| | | | | Fixed everything that depended on getting fcntl.h stuff from the wrong place. Most things don't depend on file.h stuff at all.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make this compile again after the Lite2 merge.mpp1997-02-101-2/+2
| | | | | | VOP_UNLOCK was being called with the wrong mumber of arguments. Also silenced a -Wall warning.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-2/+2
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Clean up -Wunused warnings.gpalmer1996-06-121-3/+2
| | | | Reviewed by: bde
* First pass at cleaning up macros relating to pages, clusters and all that.phk1996-05-021-3/+3
|
* Removed never-used #includes of <machine/cpu.h>. Many were apparentlybde1996-04-071-4/+1
| | | | copied from bad examples.
* Fixed unsigned longs that should have been vm_offset_t.bde1996-03-191-3/+5
| | | | | | | | | | vm_offset_t is currently unsigned long but should probably be plain unsigned for i386's to match the choice of minimal types to represent for fixed-width types in Lite2. Anyway, it shouldn't be assumed to be unsigned long. I only fixed the type mismatches that were detected when I changed vm_offset_t to unsigned. Only pointer type mismatches were detected.
* Remove references to MAP_FILE.. That is now "default" and is onlypeter1996-03-121-2/+2
| | | | a "#define MAP_FILE 0" that is still there for net-2 source compatability.
* Fix the vm_map_remove and vm_map_protect calls.. Somewhere along thepeter1996-03-101-3/+3
| | | | | | line, these had got (start, length) arguments instead of (start, end) args. This could be the cause of Robert Sanders lockups with ZMAGIC binaries.
* update linux_times() and linux_utime() emulation,peter1996-03-041-14/+43
| | | | | fix sigsuspend() (actually back out my recent change there) and regen the syscall tables..
* Mega-commit for Linux emulator update.. This has been stress tested underpeter1996-03-021-150/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | netscape-2.0 for Linux running all the Java stuff. The scrollbars are now working, at least on my machine. (whew! :-) I'm uncomfortable with the size of this commit, but it's too inter-dependant to easily seperate out. The main changes: COMPAT_LINUX is *GONE*. Most of the code has been moved out of the i386 machine dependent section into the linux emulator itself. The int 0x80 syscall code was almost identical to the lcall 7,0 code and a minor tweak allows them to both be used with the same C code. All kernels can now just modload the lkm and it'll DTRT without having to rebuild the kernel first. Like IBCS2, you can statically compile it in with "options LINUX". A pile of new syscalls implemented, including getdents(), llseek(), readv(), writev(), msync(), personality(). The Linux-ELF libraries want to use some of these. linux_select() now obeys Linux semantics, ie: returns the time remaining of the timeout value rather than leaving it the original value. Quite a few bugs removed, including incorrect arguments being used in syscalls.. eg: mixups between passing the sigset as an int, vs passing it as a pointer and doing a copyin(), missing return values, unhandled cases, SIOC* ioctls, etc. The build for the code has changed. i386/conf/files now knows how to build linux_genassym and generate linux_assym.h on the fly. Supporting changes elsewhere in the kernel: The user-mode signal trampoline has moved from the U area to immediately below the top of the stack (below PS_STRINGS). This allows the different binary emulations to have their own signal trampoline code (which gets rid of the hardwired syscall 103 (sigreturn on BSD, syslog on Linux)) and so that the emulator can provide the exact "struct sigcontext *" argument to the program's signal handlers. The sigstack's "ss_flags" now uses SS_DISABLE and SS_ONSTACK flags, which have the same values as the re-used SA_DISABLE and SA_ONSTACK which are intended for sigaction only. This enables the support of a SA_RESETHAND flag to sigaction to implement the gross SYSV and Linux SA_ONESHOT signal semantics where the signal handler is reset when it's triggered. makesyscalls.sh no longer appends the struct sysentvec on the end of the generated init_sysent.c code. It's a lot saner to have it in a seperate file rather than trying to update the structure inside the awk script. :-) At exec time, the dozen bytes or so of signal trampoline code are copied to the top of the user's stack, rather than obtaining the trampoline code the old way by getting a clone of the parent's user area. This allows Linux and native binaries to freely exec each other without getting trampolines mixed up.
* This is an extract of changes from what I am currently running...peter1996-02-161-64/+151
| | | | | | | | | | | | | | | | | | | | | | | - Optimise the linux a.out loading and uselib system calls so they take advantage of some of John's recent interface improvements. Basically, this means they make far less map changes than before. - Attempt to plug some potentially nasty kernel_map memory leaks.. - Improve support for QMAGIC libs (I only use QMAGIC (ie: a.out libraries from the slackware 3.0 dist) but this depends on other changes to enhance the /compat/linux support) - uselib goes out through a single exit as part of the resource tracking that I did when closing the resource leaks on errors. This could be cleaner than what I did, but making a 30-deep nested if/else was not my idea of fun, neither did I want to repeat the same code 30 times over for each failure possibility. I guess this function needs to be split into smaller functions to solve this. I've been running the Linux Netscape-2.0 (with Java) to test this, and apart from the long-standing problem with the missing scrollbars, it appears to still work as before with ZMAGIC libs (and the leaks).. However, I've been using it with mods for the signal trampoline code for native linux stack frames on signals and exterminated the blasted sigreturn printf() problem, so I can't be certain that there is not a dependency on something else.
* Fixed vm_map_find for new vm updates.dyson1996-01-191-4/+7
|
* Add linux_mknod so that it will do mkfifo if needed...sos1996-01-141-1/+16
|
OpenPOWER on IntegriCloud