Commit Graph

329 Commits

Author SHA1 Message Date
jhb
6f36272449 Back out proc locking to protect p_ucred for obtaining additional
references along with the actual obtaining of additional references.
2001-01-27 00:01:31 +00:00
jhb
12f0c46097 - Back out over-aggressive locking of p->p_cred.
- Back out locking ucred's and bumping refcounts for vnode operations.
2001-01-26 23:54:40 +00:00
jhb
6a6543f69a Use queue macros. 2001-01-24 00:01:42 +00:00
jhb
3ebca2f4c3 - Proc locking.
- Use queue macros.
- Use NULL instead of 0 for pointers.

Reviewed by:	des
2001-01-23 22:13:07 +00:00
jhb
55e163980d Argh, atomic_store_rel -> atomic_store_rel_int. 2001-01-23 21:40:07 +00:00
jhb
b12abb0009 Woops, add in missing headers. 2001-01-23 21:39:15 +00:00
jhb
a3ac657f1f Proc locking. 2001-01-23 21:33:55 +00:00
jhb
7e8797a19c Use queue macros. 2001-01-23 21:32:02 +00:00
jhb
c339c345f5 - Add proc locking.
- Fix several bugs in the wait syscall, including freeing the actual
  proc start, freeing the args, freeing the prison, and other minor
  nits.
- Use appropriate queue(3) macros.
- Use zpfind() instead of walking zombproc ourselves.
2001-01-23 21:30:25 +00:00
jhb
a6a7540093 - Use proper atomic operations to make the run time initialization
controlled by svr_str_initialized be MP safe.
2001-01-23 21:07:16 +00:00
jhb
9dcfcfc840 FreeBSD doesn't have p_emuldata, and our stackgap_init() doesn't take an
argument.
2001-01-23 21:02:44 +00:00
jhb
ec1d1e9e28 Use proc lock to safely obtain references to p_ucred before vnode
operations.
2001-01-23 20:52:50 +00:00
jhb
729766c296 Protect calcru() with sched_lock. 2001-01-23 20:50:40 +00:00
takawata
0d758740be Map BSS section in PECOFF executable.
Submitted by:	 KUROSAWA Takahiro <fwkg7679@mb.infoweb.ne.jp>
2001-01-23 16:19:37 +00:00
wollman
603fb7f029 Finish deprecating <sys/select.h> in favor of <sys/selinfo.h> in kernel code. 2001-01-20 02:24:07 +00:00
joe
d73659400d Instead of hard coding the major numbers for IDE and SCSI disks
look in the device's cdevsw for the D_DISK flag.
2001-01-14 23:33:50 +00:00
jake
2cfc65e106 Protect proc.p_pptr with the proctree lock. 2001-01-10 15:41:26 +00:00
green
7afbe44fc0 Take 10 seconds to actually fix the chgproccnt rather than just make it
explicitly error.  If the module is horribly broken, it should be
temporarily removed from src/sys/modules.
2001-01-09 04:55:37 +00:00
wollman
8456343ffc With some trepidation, add a `#error' directive to this module. It was
broken and not fixed by whoever changed the interface of chgproccnt();
in the state it is in it could not possibly work (dereferencing an integer).
2001-01-09 04:27:09 +00:00
paul
5f23d12edc Map FreeBSD character device hard disks to Linux block device hard disks.
This fixes the problem with VMWARE not being able to use raw disks.
2000-12-29 00:44:42 +00:00
jake
2a7c5bd038 Protect proc.p_pptr and proc.p_children/p_sibling with the
proctree_lock.

linprocfs not locked pending response from informal maintainer.

Reviewed by:	jhb, -smp@
2000-12-23 19:43:10 +00:00
takawata
9935fe89e0 Add PECOFF (WIN32 Execution file format) support.
To use it, some dll is needed. And currently, the dll is only for NetBSD.
So one more kernel module is needed.
For more infomation,
http://chiharu.haun.org/peace/ .

Reviewed by:	bp
2000-12-20 12:51:08 +00:00
assar
8315fb22d1 translate the flags in recvfrom and recvmsg from linux to bsd ones
Approved by:	marcel
2000-12-19 00:24:25 +00:00
jhb
f7995323db Lock access to proc members.
Glanced over by:	marcel
2000-12-15 19:41:27 +00:00
des
1a07b2fbc9 Use kinfo_proc instead of eproc (which Kirk deep-sixed earlier this week)
Generate a version string that looks just like a real Linux one - almost :)

Use sbufs everywhere instead of sprintf(). Note that this is still imperfect,
as the code does not check whether the sbuf overflowed - but it'll still
work better than before, since if the sbuf overflows, the code now simply
copies out 0 bytes instead of causing a trap (or worse, corrupting kernel
structures)
2000-12-13 20:22:24 +00:00
des
5a046c3b64 Add dependency on linux, which is needed for proc/version. 2000-12-13 20:19:06 +00:00
jake
642b119420 Lock the allproc list.
Approved by:	DES
2000-12-13 09:05:45 +00:00
jake
518b4c0aea - Change the allproc_lock to use a macro, ALLPROC_LOCK(how), instead
of explicit calls to lockmgr.  Also provides macros for the flags
  pased to specify shared, exclusive or release which map to the
  lockmgr flags.  This is so that the use of lockmgr can be easily
  replaced with optimized reader-writer locks.
- Add some locking that I missed the first time.
2000-12-13 00:17:05 +00:00
des
582cf6df76 Point #includes at compat/linprocfs instead of i386/linux/linprocfs. 2000-12-12 22:06:05 +00:00
des
92bedf9d12 Add proc/<pid>/cmdline. 2000-12-09 16:20:48 +00:00
des
3207db6509 Add a dependency on procfs. 2000-12-09 16:20:35 +00:00
des
73d8342016 A bunch of fixes that have been rotting in my tree for a month or two
waiting for procfs to get fixed:

  - Use fill_eproc() to obtain correct VM stats. Attempt to compute VmLib.

  - Fill some more fields in proc/<pid>/stat, and add four (unimplemented)
    fields after studying a recent Linux kernel.

  - Compute CPU frequency only once instead of twice.

  - Fix some comments that were OBE.

  - Fix indentation except where it makes the code less readable.
2000-12-09 13:25:54 +00:00
marcel
ae80563f38 Remove call to bzero after MALLOC and instead add M_ZERO
to MALLOC.
2000-12-05 06:44:22 +00:00
marcel
131c610840 Include machine/cpu.h for cpu_getstack().
Spotted by: jake
2000-12-03 01:56:15 +00:00
marcel
3e304e6b3a Don't auto-generate the syscalls. 2000-12-03 01:30:31 +00:00
jhb
d7d51daa94 Protect access to p_stat with sched_lock. 2000-12-01 06:34:19 +00:00
marcel
519f275c1f Don't use p->p_sigstk.ss_flags to keep state of whether the
process is on the alternate stack or not. For compatibility
with sigstack(2) state is being updated if such is needed.

We now determine whether the process is on the alternate
stack by looking at its stack pointer. This allows a process
to siglongjmp from a signal handler on the alternate stack
to the place of the sigsetjmp on the normal stack. When
maintaining state, this would have invalidated the state
information and causing a subsequent signal to be delivered
on the normal stack instead of the alternate stack.

PR: 22286
2000-11-30 05:23:49 +00:00
jake
f7b749c287 Use callout_reset instead of timeout(9). Most callouts are statically
allocated, 2 have been added to struct proc for setitimer and sleep.

Reviewed by:	jhb, jlemon
2000-11-27 22:52:31 +00:00
des
e6aa0256c7 Add bogomips to cpuinfo (set it equal to the CPU frequency, which is bogus
but not more so than Linux' definition).
This should get the IBM JDK 1.3 working again.

Prompted by:	sobomax
2000-11-27 11:10:03 +00:00
dillon
db5ee37fed Forgot to patch this file in file descriptor race fix commit
Submitted-by: "Danny J. Zerkel" <dzerkel@columbus.rr.com>
2000-11-23 11:05:14 +00:00
gallatin
ae7541c2af Use the linux_connect() on alpha rather than passing directly through
to our native connect().  This is required to deal with the differences
in the way linux handles connects on non-blocking sockets.

This gets the private beta of the Compaq Linux/alpha JDK working
on FreeBSD/alpha

Approved by: marcel
2000-11-16 01:05:53 +00:00
marcel
f3e99f9e67 Fix F_SETOWN on pipes. Linux returns EINVAL while we send a SIGIO
signal. There's at least 1 program that is known to break.
Submitted patch has been edited to match current code.

MFC: yes
Submitted by: bde
2000-11-13 04:08:56 +00:00
marcel
8d972f32a5 Revert auto-generation. The Alpha port is broken.
Syncing with it is wrong.
2000-11-10 21:30:19 +00:00
marcel
7a85ddcb36 Make MINSIGSTKSZ machine dependent, and have the sigaltstack
syscall compare against a variable sv_minsigstksz in struct
sysentvec as to properly take the size of the machine- and
ABI dependent struct sigframe into account.

The SVR4 and iBCS2 modules continue to have a minsigstksz of
8192 to preserve behavior. The real values (if different) are
not known at this time. Other ABI modules use the real
values.

The native MINSIGSTKSZ is now defined as follows:

Arch		MINSIGSTKSZ
----		-----------
alpha		    4096
i386		    2048
ia64		   12288

Reviewed by: mjacob
Suggested by: bde
2000-11-09 08:25:48 +00:00
marcel
9f3dfd7355 Sync with Alpha:
Do not use sysent.c, proto.h and syscall.h in source tree;
use auto-generated versions.
2000-11-09 07:27:55 +00:00
des
3ea354e48a Check that p->p_pptr is not NULL - kernel processes have no parents! 2000-11-06 03:23:56 +00:00
marcel
763b742274 Fix getdents syscall.
The offset field in struct dirent was set to the offset of
the next dirent in rev 1.36. The offset was calculated from
the current offset and the record length. This offset does
not necessarily match the real offset when we are using
cookies. Therefore, also use the cookies to set the offset
field in struct dirent if we're using cookies to iterate
through the dirents.
2000-11-05 07:31:17 +00:00
gallatin
b6a0e0d982 zap a stray include that snuck in with rev 1.56
Submitted by:	Clive Lin <clive@CirX.ORG>
2000-11-02 18:51:32 +00:00
gallatin
4ad7832001 fix a comment that was inadvertantly changed by a cvs merge
pointed out by: obrien
2000-11-02 15:04:19 +00:00
marcel
004207ca85 Fix linux_ustat syscall. We only have cdevs now, so looking
for a block device isn't that useful anymore.

Reported by: Wesley Morgan <morganw@chemicals.tacorp.com>
Submitted by: gallatin
Acknowledged by: phk
2000-11-02 06:08:26 +00:00