Commit Graph

9447 Commits

Author SHA1 Message Date
John Dyson
c2e11a039d Change bogus usage of btoc to atop. The incorrect usage of btoc was
pointed out by bde.
1997-12-19 15:31:13 +00:00
Bruce Evans
29fac97c4f Fixed namespace pollution in previous commit.
Merged KERNEL ifdefs.
1997-12-19 10:03:31 +00:00
Andrey A. Chernov
17b6b6d61d SUNIT: use MALLOC/FREE and M_NOWAIT 1997-12-19 09:48:57 +00:00
John Dyson
1efb74fbcc Some performance improvements, and code cleanups (including changing our
expensive OFF_TO_IDX to btoc whenever possible.)
1997-12-19 09:03:37 +00:00
Julian Elischer
45d6875df6 Fix an incredibly horrible bug in the ipfw code
where if you are using the "reset tcp" firewall command,
the kernel would write ethernet headers onto random kernel stack locations.

Fought to the death by: terry, julian, archie.
fix valid for 2.2 series as well.
1997-12-19 03:36:15 +00:00
John Dyson
a5f4cd5623 Correct the check for multiword dma. It was incorrectly checking
for multiword dma mode 4 (which doesn't exist.)
Submitted by:	John Hood
1997-12-19 02:25:51 +00:00
Bruce Evans
8cd077a7fd Augment $PATH to ensure searching of /sbin and /usr/sbin for sysctl
instead of using an absolute path to sysctl.
Problem reported by: ache
1997-12-18 21:03:04 +00:00
David Greenman
744f87ea73 Fixed a missing splx(s) bug in tcp_usr_send(). 1997-12-18 09:50:38 +00:00
David Greenman
86b3ebce35 Call in_pcballoc() at splnet(). As near as I can tell, this won't fix
any instability problems, but it was wrong nonetheless and will be
required in an upcoming round of PCB changes.
1997-12-18 09:13:39 +00:00
Peter Wemm
9b73941153 Add missing references to Xcpuast, get_isrlock and checkstate_probed_cpus 1997-12-18 02:09:29 +00:00
Garrett Wollman
e51d1e8707 Revert poll() for UFS files to traditional behavior where polling for read-
or writability always returns true.  This works around bugs in netscape and
squid, at a minimum.
1997-12-17 14:44:23 +00:00
KATO Takenori
76ef01374e Regenerate (fix argument of linux_nice). 1997-12-17 03:16:11 +00:00
KATO Takenori
c7da3245da I should not edit linux_prot.h directly. Fix the argument of linux_nice.
Pointed out by:	Eivind Eklund <eivind@FreeBSD.ORG>
	NOPROTO	LINUX	{ int getpgrp(void); }
66	NOPROTO	LINUX	{ int setsid(void); }
67	STD	LINUX	{ int linux_sigaction(int sig, \
			    struct linux_sigaction *nsa, \
			    struct linux_sigaction *osa); }
68	STD	LINUX	{ int linux_siggetmask(void); }
69	STD	LINUX	{ int linux_sigsetmask(linux_sigset_t mask); }
70	NOPROTO	LINUX	{ int setreuid(int ruid, int euid); }
71	NOPROTO	LINUX	{ int setregid(int rgid, int egid); }
72	STD	LINUX	{ int linux_sigsuspend(int restart, \
			    linux_sigset_t oldmask, linux_sigset_t mask); }
73	STD	LINUX	{ int linux_sigpending(linux_sigset_t *mask); }
74	NOPROTO	LINUX	{ int osethostname(char *hostname, \
			    u_int len);}
75	NOPROTO	LINUX	{ int osetrlimit(u_int which, \
			    struct ogetrlimit *rlp); }
76	NOPROTO	LINUX	{ int ogetrlimit(u_int which, \
			    struct ogetrlimit *rlp); }
77	NOPROTO	LINUX	{ int getrusage(int who, struct rusage *rusage); }
78	NOPROTO	LINUX	{ int gettimeofday(struct timeval *tp, \
			    struct timezone *tzp); }
79	NOPROTO	LINUX	{ int settimeofday(struct timeval *tp, \
			    struct timezone *tzp); }
80	NOPROTO	LINUX	{ int getgroups(u_int gidsetsize, gid_t *gidset); }
81	NOPROTO	LINUX	{ int setgroups(u_int gidsetsize, gid_t *gidset); }
82	STD	LINUX	{ int linux_select(struct linux_select_argv *ptr); }
83	STD	LINUX	{ int linux_symlink(char *path, char *to); }
84	NOPROTO	LINUX	{ int ostat(char *path, struct ostat *up); }
85	STD	LINUX	{ int linux_readlink(char *name, char *buf, \
			    int count); }
86	STD	LINUX	{ int linux_uselib(char *library); }
87	NOPROTO	LINUX	{ int swapon(char *name); }
88	NOPROTO	LINUX	{ int reboot(int opt); }
89	STD	LINUX	{ int linux_readdir(int fd, struct linux_dirent *dent, \
			    unsigned int count); }
90	STD	LINUX	{ int linux_mmap(struct linux_mmap_argv *ptr); }
91	NOPROTO	LINUX	{ int munmap(caddr_t addr, int len); }
92	STD	LINUX	{ int linux_truncate(char *path, long length); }
93	NOPROTO	LINUX	{ int oftruncate(int fd, long length); }
94	NOPROTO	LINUX	{ int fchmod(int fd, int mode); }
95	NOPROTO	LINUX	{ int fchown(int fd, int uid, int gid); }
96	NOPROTO	LINUX	{ int getpriority(int which, int who); }
97	NOPROTO	LINUX	{ int setpriority(int which, int who, int prio); }
98	NOPROTO	LINUX	{ int profil(caddr_t samples, u_int size, \
			    u_int offset, u_int scale); }
99	STD	LINUX	{ int linux_statfs(char *path, \
			    struct linux_statfs_buf *buf); }
100	STD	LINUX	{ int linux_fstatfs(int fd, \
			    struct linux_statfs_buf *buf); }
101	STD	LINUX	{ int linux_ioperm(unsigned int lo, \
			    unsigned int hi, int val); }
102	STD	LINUX	{ int linux_socketcall(int what, void *args); }
103	STD	LINUX	{ int linux_ksyslog(int what); }
104	STD	LINUX	{ int linux_setitimer(u_int which, \
			    struct itimerval *itv, struct itimerval *oitv); }
105	STD	LINUX	{ int linux_getitimer(u_int which, \
			    struct itimerval *itv); }
106	STD	LINUX	{ int linux_newstat(char *path, \
			    struct linux_newstat *buf); }
107	STD	LINUX	{ int linux_newlstat(char *path, \
			    struct linux_newstat *buf); }
108	STD	LINUX	{ int linux_newfstat(int fd, struct linux_newstat *buf); }
109	STD	LINUX	{ int linux_uname(struct linux_old_utsname *up); }
110	STD	LINUX	{ int linux_iopl(int level); }
111	STD	LINUX	{ int linux_vhangup(void); }
112	STD	LINUX	{ int linux_idle(void); }
113	STD	LINUX	{ int linux_vm86(void); }
114	STD	LINUX	{ int linux_wait4(int pid, int *status, \
			    int options, struct rusage *rusage); }
115	STD	LINUX	{ int linux_swapoff(void); }
116	STD	LINUX	{ int linux_sysinfo(void); }
117	STD	LINUX	{ int linux_ipc(int what, int arg1, int arg2, int arg3, \
			    caddr_t ptr); }
118	NOPROTO	LINUX	{ int fsync(int fd); }
119	STD	LINUX	{ int linux_sigreturn(struct linux_sigcontext *scp); }
access
1997-12-17 03:12:35 +00:00
Eivind Eklund
f41991ba10 EXT2FS and MSDOSFS to the opt_dontuse bin. 1997-12-16 23:59:37 +00:00
Eivind Eklund
b449fccbbc Fix my typo.
Submitted by: helbig
1997-12-16 22:50:18 +00:00
Eivind Eklund
16a4e2f328 Make LINT compile again after wollman introduced poll() here.
Overlooked by:	wollman
1997-12-16 22:28:26 +00:00
Eivind Eklund
4027779c22 Regenerate after changing makesyscalls.sh. 1997-12-16 22:27:22 +00:00
Eivind Eklund
0b3c4d50c2 Move around opt_compat include to accomodate Linulator brokenness (for
the time being).
1997-12-16 18:51:45 +00:00
Eivind Eklund
8438b90fd3 Make hidden COMPAT_43 dependencies explict. Options in headers is a
pain in the backside.
1997-12-16 18:49:23 +00:00
Eivind Eklund
e9161c5082 Handle COMPAT_43 define -> option change. 1997-12-16 18:45:50 +00:00
Eivind Eklund
f9b59e80d5 Whoops - fix this after yesterday's IPX option changes. Also fix
minor buglet when neither bsdcomp, deflate or filter is used.

Pointed out by:	Chris Timmons <skynyrd@opus.cts.cwu.edu>
1997-12-16 18:28:07 +00:00
Eivind Eklund
5591b823d1 Make COMPAT_43 and COMPAT_SUNOS new-style options. 1997-12-16 17:40:42 +00:00
David Greenman
c7ce9e2634 Fix bug where a struct buf was free()'d back to the system malloc pool.
Quite amazing that the system runs at all with this bug. Also present in
2.2.5. The bug appears to have come in with changes in rev 1.53.

PR:		might fix PR#5313
Submitted by:	bde
1997-12-16 15:40:29 +00:00
KATO Takenori
cf478d7b45 Don't use PG_N if EPSON PC-486HX/HG/HA (PC-9801 compatible) are
detected.  These machine cannot make L2 cache write-through by PG_N,
and only I/O access (undocumented) can do that.  If PG_N is used,
system hangs.

Reviewed by:	tos@fa2.so-net.or.jp (Toshiyuki Kawashima)
1997-12-16 10:22:49 +00:00
Eivind Eklund
8c13c35718 Convert SUIDDIR fully to a new-style option.
Forgotten by: julian
1997-12-15 21:51:45 +00:00
Eivind Eklund
430df5f4b7 Throw options IPX, IPXIP and IPTUNNEL into opt_ipx.h.
The #ifdef IPXIP in netipx/ipx_if.h is OK (used from ipx_usrreq.c and
ifconfig.c only).

I also fixed a typo IPXTUNNEL -> IPTUNNEL (and #ifdef'ed out the code
inside, as it never could have compiled - doh.)
1997-12-15 20:31:25 +00:00
KATO Takenori
76733e040d Sync with sys/i386/i386/microtime.s revision 1.35. 1997-12-15 08:37:13 +00:00
Mike Smith
7ebfc603cf As described by the submitter:
These patches enables us to play quake2 .

Support linux keyboard ioctl for setting RAW, MEDIUMRAW and XLATE.

Support linux virtual terminal operations:
 OPENQRY, GETMODE, SETMODE, GETSTATE, ACTIVATE, and WAITACTIVE.

Submitted by:	Amancio Hasty <hasty@rah.star-gate.com>
1997-12-15 06:09:11 +00:00
John Dyson
bd28588799 Fix a recursive kernel_map lock problem in vm_zone allocator.
PR:	5298
1997-12-15 05:16:09 +00:00
Garrett Wollman
1cbbd625cc Add support for poll(2) on files. vop_nopoll() now returns POLLNVAL
if one of the new poll types is requested; hopefully this will not break
any existing code.  (This is done so that programs have a dependable
way of determining whether a filesystem supports the extended poll types
or not.)

The new poll types added are:

	POLLWRITE - file contents may have been modified
	POLLNLINK - file was linked, unlinked, or renamed
	POLLATTRIB - file's attributes may have been changed
	POLLEXTEND - file was extended

Note that the internal operation of poll() means that it is impossible
for two processes to reliably poll for the same event (this could
be fixed but may not be worth it), so it is not possible to rewrite
`tail -f' to use poll at this time.
1997-12-15 03:09:59 +00:00
Mike Smith
0bec68bf7c Consult sa_len before trampling it with MSG_COMPAT set.
PR:             kern/5291
Submitted by:   pb@fasterix.freenix.org (Pierre Beyssac)
1997-12-15 02:29:11 +00:00
Tor Egge
5c623cb649 Add support for low resolution SMP kernel profiling.
- A nonprofiling version of s_lock (called s_lock_np) is used
    by mcount.

  - When profiling is active, more registers are clobbered in
    seemingly simple assembly routines. This means that some
    callers needed to save/restore extra registers.

  - The stack pointer must have space for a 'fake' return address
    in idle, to avoid stack underflow.
1997-12-15 02:18:35 +00:00
Tor Egge
549a42942d Don't forward hardclock or statclock to stopped cpus. Disable forwarding
when a panic has occured.
1997-12-15 01:14:10 +00:00
Sean Eric Fagan
64fce5b3cb Explicitly use the _IOC macro directly. This changes the ioctl command
numbers, so any programs using it need to be recompiled.
1997-12-15 00:29:41 +00:00
John Polstra
a8e99ec909 Make gzipped dynamically linked executables work again. There was
an old bug here that failed to copy the a.out header into memory
properly.  It didn't matter until changes were made recently to
the dynamic linker.
1997-12-14 19:36:24 +00:00
KATO Takenori
80ed4956b5 Sync with sys/i386/i386/machdep.c revision 1.279. 1997-12-14 12:31:44 +00:00
KATO Takenori
162c095232 Sync with sys/i386/conf/files.i386 revision 1.182. 1997-12-14 12:30:54 +00:00
John Dyson
b0d8408e21 Slight improvement to the vm_zone stats output. Also, some other superficial
cleanups.
1997-12-14 05:17:44 +00:00
Mike Smith
f2477ae13d As described by the submitter:
- emulate Linux IP_HDRINCL behaviour in sendto(): byte order fixed
	  Note that we do an extra getsockopt() on every sendto()
	  to check if the option is set because we don't keep state
	  in the emulator code. Is there a better way to implement
	  this?
	- correct a bug (value of "name" not passed) with
	  getsockopt()

Submitted by:	pb@fasterix.freenix.org (Pierre Beyssac)
1997-12-14 03:17:54 +00:00
Mike Smith
5af7db2b73 As described by the submitter:
... fix a bug with orecvfrom() or recvfrom() called with
the MSG_COMPAT flag on kernels compiled with the COMPAT_43 option.
The symptom is that the fromaddr is not correctly returned.

This affects the Linux emulator.

Submitted by:	pb@fasterix.freenix.org (Pierre Beyssac)
1997-12-14 03:15:21 +00:00
John Dyson
8256655132 After one of my analysis passes to evaluate methods for SMP TLB mgmt, I
noticed some major enhancements available for UP situations.  The number
of UP TLB flushes is decreased much more than significantly with these
changes.  Since a TLB flush appears to cost minimally approx 80 cycles,
this is a "nice" enhancement, equiv to eliminating between 40 and 160
instructions per TLB flush.

Changes include making sure that kernel threads all use the same PTD,
and eliminate unneeded PTD switches at context switch time.
1997-12-14 02:11:23 +00:00
James Raynard
5ecfccd5ba Allow slow SCSI CDROMs more time to start up.
PR:		5181
Submitted by:	Wilko Bulte <wilko@yedi.iaf.nl>
1997-12-14 00:32:33 +00:00
Paul Traina
8a0eb35293 Bring in NetBSD compatible & augmented RCSID/COPYRIGHT macros 1997-12-13 20:39:14 +00:00
Bruce Evans
80987b7a3b Fixed EOF handing.
1. SS_CANTRCVMORE was initially set on the wrong socket, so reads
when there has never been a writer on the socket did not return 0.
Note that such reads are only possible if the fifo was opened in
(O_RDONLY | O_NONBLOCK) mode.

2. SS_CANTSENDMORE was initially set on the wrong socket, but this
was harmless because the wrong socket is never sent from and there
is no need to set the flag initially on the right socket (since open
in (O_WRONLY | O_NONBLOCK) mode fails if there is no reader...).

3. SS_CANTRCVMORE was cleared when read() returns.  This broke the
case where read() returns 0 - subsequent reads are supposed to
return 0 until a writer appears.  There is no need to clear the
flag when read() returns, since it is cleared correctly when a
writer appears.
1997-12-13 13:49:59 +00:00
Bruce Evans
5fb0d3e0b3 Restored fifo_pathconf() from rev.1.32. vop_stdpathconf() is too
general to be of much use.  Using it here weakened the _PC_MAX_CANON,
_PC_MAX_INPUT and _PC_VDISABLE cases.

fifo_pathconf() is not quite correct either.  _PC_CHOWN_RESTRICTED
and _PC_LINK_MAX should be handled by the host file system.  For
directories, the host file system should let us handle _PC_PIPE_BUF.
1997-12-13 12:58:09 +00:00
Bruce Evans
2573d99c75 Restored ufs_pathconf() from rev.1.61. vop_stdpathconf() is too
general to be of much use.  Using it here broke the _PC_NAME_MAX,
_PC_NO_TRUNC and _PC_PATH_MAX cases, and weakened the _PC_MAX_CANON,
_PC_MAX_INPUT and _PC_VDISABLE cases.
1997-12-13 12:30:34 +00:00
Sean Eric Fagan
d7b7dcba41 Change the ioctls for procfs around a bit; in particular, whever possible,
change from

	ioctl(fd, PIOC<foo>, &i);

to

	ioctl(fd, PIOC<foo>, i);

This is going from the _IOW to _IO ioctl macro.  The kernel, procctl, and
truss must be in synch for it all to work (not doing so will get errors about
inappropriate ioctl's, fortunately).  Hopefully I didn't forget anything :).
1997-12-13 03:13:49 +00:00
Tor Egge
80db913bd6 Add needed #include.
Problem found by: Bruce Evans <bde@zeta.org.au>
1997-12-12 21:45:23 +00:00
Peter Wemm
32935219ba Fix(?) some style consistancy breakage and do some other nit-picking on
the SUIDDIR changes.
1997-12-12 14:14:44 +00:00
Peter Wemm
5eaf45f67b I've been using these tweaks to enable the sound driver to talk to the
(mutant) Crystal CSS4236 chip on the Intel PR440FX SMP motherboard.

XXX this uses some rather ugly PnP bootstrap code that is *NOT* compatable
with 'controller pnp0' or *ANY* other PnP devices.  If you use some other
PnP devices, enabling css0 will burn your house down. :-]  The
"simplified" PnP init sequence directly blats your config(8) settings onto
the chip.  I'm pretty sure 'css0' will conflict with 'mss0', this whole
area desperately needs a cleanup.

I have been using the following with some success on the PR440FX:
controller   snd0
device css0  at isa? port 0x534 irq 5 drq 1 flags 0x08 vector adintr
device opl0  at isa? port 0x388
device mpu0  at isa? port 0x330 irq 10 vector mpuintr
1997-12-12 14:08:50 +00:00