Commit Graph

1950 Commits

Author SHA1 Message Date
phk
a80d5b3d3d Remove the tc_update() function. Any frequency change to the
timecounter will be used starting at the next second, which is
good enough for sysctl purposes.  If better adjustment is needed
the NTP PLL should be used.
2002-04-26 10:06:26 +00:00
nyan
08c9d93484 MFi386: revision 1.339. 2002-04-25 13:32:56 +00:00
nyan
d3eae2405a Merged from sys/dev/syscons/syscons.c revision 1.383 2002-04-25 13:25:36 +00:00
mux
01b4d5f876 Rework the kernel environment subsystem. We now convert the static
environment needed at boot time to a dynamic subsystem when VM is
up.  The dynamic kernel environment is protected by an sx lock.

This adds some new functions to manipulate the kernel environment :
freeenv(), setenv(), unsetenv() and testenv().  freeenv() has to be
called after every getenv() when you have finished using the string.
testenv() only tests if an environment variable is present, and
doesn't require a freeenv() call. setenv() and unsetenv() are self
explanatory.

The kenv(2) syscall exports these new functionalities to userland,
mainly for kenv(1).

Reviewed by:	peter
2002-04-17 13:06:36 +00:00
kato
616aed3214 MFi386: revision 1.517. 2002-04-11 09:45:41 +00:00
phk
1d270f9db2 GC various bits and pieces of USERCONFIG from all over the place. 2002-04-09 11:18:46 +00:00
phk
aaa070e2bd GC the "dumplo" variable, which is no longer used.
A lot of sys/*/*/machdep.c seems not to be.
2002-04-07 21:01:37 +00:00
nyan
9e9d98c4d4 Merged from sys/dev/syscons/syscons.c revisions 1.381 and 1.382. 2002-04-06 06:47:23 +00:00
nyan
f67bcd3239 Merged from sys/isa/fd.c revision 1.228. 2002-04-06 06:43:55 +00:00
nyan
4362a79991 Merged from sys/dev/sio/sio.c revisions 1.370 and 1.371. 2002-04-06 06:19:10 +00:00
jhb
5a4577c2f0 Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64
2002-04-04 21:03:38 +00:00
bde
0785888ad7 Moved signal handling and rescheduling from userret() to ast() so that
they aren't in the usual path of execution for syscalls and traps.
The main complication for this is that we have to set flags to control
ast() everywhere that changes the signal mask.

Avoid locking in userret() in most of the remaining cases.

Submitted by:	luoqi (first part only, long ago, reorganized by me)
Reminded by:	dillon
2002-04-04 17:49:48 +00:00
ru
b7ddbbd101 Dike out a highly insecure UCONSOLE option.
TIOCCONS must be able to VOP_ACCESS() /dev/console to succeed.

Obtained from:	OpenBSD
2002-04-03 10:56:59 +00:00
jhb
da34279b8c - Move the MI mutexes sched_lock and Giant from being declared in the
various machdep.c's to being declared in kern_mutex.c.
- Add a new function mutex_init() used to perform early initialization
  needed for mutexes such as setting up thread0's contested lock list
  and initializing MI mutexes.  Change the various MD startup routines
  to call this function instead of duplicating all the code themselves.

Tested on:	alpha, i386
2002-04-02 22:19:16 +00:00
jhb
e3cbbf9804 Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@
2002-04-01 21:31:13 +00:00
kato
bd42727fd9 MFi386: revision 1.508. 2002-03-31 08:00:35 +00:00
nyan
74f2bacaa1 MFi386: revision 1.506. 2002-03-30 11:14:52 +00:00
kato
8076ddae64 MFi386: revision 1.507. 2002-03-27 11:29:40 +00:00
dillon
621ffb376c Compromise for critical*()/cpu_critical*() recommit. Cleanup the interrupt
disablement assumptions in kern_fork.c by adding another API call,
cpu_critical_fork_exit().  Cleanup the td_savecrit field by moving it
from MI to MD.  Temporarily move cpu_critical*() from <arch>/include/cpufunc.h
to <arch>/<arch>/critical.c (stage-2 will clean this up).

Implement interrupt deferral for i386 that allows interrupts to remain
enabled inside critical sections.  This also fixes an IPI interlock bug,
and requires uses of icu_lock to be enclosed in a true interrupt disablement.

This is the stage-1 commit.  Stage-2 will occur after stage-1 has stabilized,
and will move cpu_critical*() into its own header file(s) + other things.
This commit may break non-i386 architectures in trivial ways.  This should
be temporary.

Reviewed by:	core
Approved by:	core
2002-03-27 05:39:23 +00:00
phk
5d1b930ed6 Push BIO_FORMAT into a local hack inside the floppy drivers where
it belongs.
2002-03-26 19:16:37 +00:00
nyan
431064acff Merged from sys/dev/sio/sio.c revisions 1.366 and 1.369. 2002-03-25 13:41:06 +00:00
nyan
2ad369d044 Merged from sys/dev/syscons/syscons.c revision 1.379. 2002-03-25 13:34:37 +00:00
nyan
2223c50652 Fix style. 2002-03-25 12:44:03 +00:00
kato
1253c2a30b MFi386: revision 1.65. 2002-03-20 12:28:03 +00:00
kato
565671dd1e Remove __P. 2002-03-20 12:22:31 +00:00
kato
c81d8815b8 Remove __P. 2002-03-20 11:52:56 +00:00
kato
ce417fab32 MFi386: revision 1.505 (remove __P.) 2002-03-20 11:31:17 +00:00
kato
de044af2cf MFi386: revision 1.504. 2002-03-20 11:15:05 +00:00
kato
5b1e80861a MFi386: revision 1.503. 2002-03-20 11:13:41 +00:00
nyan
12160e97be Use the dx register for the destination port address. A immediate port
address of outb is only 8 bits.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
MFC after:	3 days
2002-03-13 13:59:41 +00:00
nyan
0cb3d1a538 MFi386: revision 1.502 2002-03-13 13:45:00 +00:00
nyan
6908e0bef9 Free allocated buffer at siodetach().
MFC after:	3 days
2002-03-10 07:22:42 +00:00
nyan
f642d75a84 MFi386: revision 1.501 2002-03-10 06:19:37 +00:00
nyan
9142c1d158 - The pc98_ttspeedtab() function returns an error status instead of a divisor,
and sets a divisor to the third argument.
- The second argument of the pc98_set_baud_rate() function is changed from int
  to u_int.
2002-03-08 12:12:46 +00:00
nyan
3cb712268c MFi386: revision 1.125 2002-03-08 11:38:00 +00:00
nyan
7d106523c4 MFi386: revision 1.498. 2002-03-02 13:19:22 +00:00
jhb
8bda78899a Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.
2002-02-27 18:32:23 +00:00
phk
5f6380ee08 Disksort will not "munge" requests, BIO_ORDERED or not, so remove
use of BIO_ORDERED.
2002-02-22 09:14:06 +00:00
nyan
c9425b7ae6 MFi386: revision 1.497 2002-02-20 05:09:57 +00:00
nyan
ebabc43a41 Add bus_space_unmap() and bus_space_free() functions to release
a bus_space_handle allocated by bus_space_subregion().
2002-02-18 13:44:46 +00:00
nyan
2df0e81997 - Split the routine to initialize a bus_space_handle into the separate
function.
- Only access a bus_space_handle if the resource type is SYS_RES_MEMORY or
  SYS_RES_IOPORT.
- Add the bus_space_subregion supports.
2002-02-17 09:16:45 +00:00
nyan
7d484a8258 MFi386: revisions 1.334 and 1.335 2002-02-16 13:13:22 +00:00
nyan
62695127c5 MFi386: revisions 1.495 and 1.496 2002-02-16 12:59:58 +00:00
nyan
d680a806e2 Fall through from AT_TYPE_DIRECT to AT_TYPE_CDROM.
Old ATAPI CD-ROM drives return 0 (direct-access) as the type of the device.

(The ata driver has the same problem.)

MFC after:	3 days
2002-02-11 05:46:25 +00:00
nyan
373df32b98 Cosmetic changes. 2002-02-10 10:27:37 +00:00
nyan
362046cd75 - Refine the iskanji1 function.
- Print continuous ascii characters at a time.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2002-02-10 10:15:41 +00:00
nyan
1a2dc62470 Fixed mouse cursor on a console.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2002-02-10 10:14:39 +00:00
nyan
90a259ad6a MFi386: revisions 1.493 and 1.494. 2002-02-08 11:14:16 +00:00
julian
0958947c0b Pre-KSE/M3 commit.
this is a low-functionality change that changes the kernel to access the main
thread of a process via the linked list of threads rather than
assuming that it is embedded in the process. It IS still embeded there
but remove all teh code that assumes that in preparation for the next commit
which will actually move it out.

Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
2002-02-07 20:58:47 +00:00
bde
3a7a0d07b5 Use osigreturn(2) instead of sigreturn(2) plus broken magic for returning
from old signal handlers.  This is simpler and faster, and fixes (new)
sigreturn(2) when %eip in the new signal context happens to match the
magic value (0x1d516).  0x1d516 is below the default ELF text section,
so this probably never broken anything in practice.

locore.s:
In addition, don't build the signal trampoline for old signal handlers
when it is not used.

alpha:
Not fixed, but seems to be even less broken in practice due to more
advanced magic. A false match occurs for register #32 in mc_regs[].
Since there is no hardware register #32, a false match is only possible
for direct calls to sigreturn(2) that happen to have the magic number
in the spare mc_regs[32] field.
2002-02-03 09:13:58 +00:00
bde
5821e4900c Improve the change in the previous commit: use a stub for osigreturn()
when it is not really used instead of unconditionalizing all of it.
2002-02-03 04:09:02 +00:00
bde
ce22466653 Compile osigreturn() unconditionally since it will always be needed on
some arches and the syscall table is machine-independent.  It was
(bogusly) conditional on COMPAT_43, so this usually makes no difference.

ia64: in addition:
- replace the bogus cloned comment before osigreturn() by a correct one.
  osigreturn() is just a stub fo ia64's.
- fix the formatting of cloned comment before sigreturn().
- fix the return code.  use nosys() instead of returning ENOSYS to get
  the same semantics as if the syscall is not in the syscall table.
  Generating SIGSYS is actually correct here.
- fix style bugs.

powerpc: copy the cleaned up ia64 stub.  This mainly fixes a bogus comment.

sparc64: copy the cleaned up the ia64 stub, since there was no stub before.
2002-02-01 15:44:03 +00:00
nyan
b35a5ca4a4 MFi386: revision 1.489. 2002-01-31 08:35:38 +00:00
nyan
3b4c306636 Changed iskanji[12] to inline functions. 2002-01-31 08:29:46 +00:00
nyan
985921bf36 Merged from sys/dev/sio/{sio.c,sio_isa.c} revisions 1.363 and 1.5,
respectively.
2002-01-31 08:26:45 +00:00
nyan
da47d8fa71 MFi386: revision 1.180 2002-01-31 04:28:52 +00:00
nyan
5442795239 MFi386: revision 1.52 2002-01-31 04:22:20 +00:00
nyan
1eff4a71f5 MFi386: revision 1.64 2002-01-18 03:33:52 +00:00
nyan
d293e099af Merged from sys/dev/sio/sio.c revisions from 1.360 to 1.362. 2002-01-18 03:30:22 +00:00
nyan
64d79ef5a8 MFi386: revision 1.487 2002-01-18 03:28:02 +00:00
bde
e72b0c43a4 Clear the single-step flag for signal handlers. This fixes bogus trace
traps on the first instruction of signal handlers.

In trap.c:syscall(), fake a trace trap if the single-step flag was set
on entry to the kernel, not if it will be set on exit from the kernel.
This fixes bogus trace traps after the last instruction of signal handlers.

gdb-4.18 (the version in FreeBSD) still has problems with the program in
the PR.  These seem to be due to bugs in gdb and not in FreeBSD, and are
fixed in gdb-5.1 (the distribution version).

PR:		33262
Tested by:	k Macy <kip_macy@yahoo.com>
MFC after:	1 day
2002-01-10 11:49:55 +00:00
nyan
f33c9933e7 Merged from sys/dev/sio/sio.c revisions 1.354 and 1.358. 2002-01-06 09:54:50 +00:00
jhb
68929e8e5a Change the preemption code for software interrupt thread schedules and
mutex releases to not require flags for the cases when preemption is
not allowed:

The purpose of the MTX_NOSWITCH and SWI_NOSWITCH flags is to prevent
switching to a higher priority thread on mutex releease and swi schedule,
respectively when that switch is not safe.  Now that the critical section
API maintains a per-thread nesting count, the kernel can easily check
whether or not it should switch without relying on flags from the
programmer.  This fixes a few bugs in that all current callers of
swi_sched() used SWI_NOSWITCH, when in fact, only the ones called from
fast interrupt handlers and the swi_sched of softclock needed this flag.
Note that to ensure that swi_sched()'s in clock and fast interrupt
handlers do not switch, these handlers have to be explicitly wrapped
in critical_enter/exit pairs.  Presently, just wrapping the handlers is
sufficient, but in the future with the fully preemptive kernel, the
interrupt must be EOI'd before critical_exit() is called.  (critical_exit()
can switch due to a deferred preemption in a fully preemptive kernel.)

I've tested the changes to the interrupt code on i386 and alpha.  I have
not tested ia64, but the interrupt code is almost identical to the alpha
code, so I expect it will work fine.  PowerPC and ARM do not yet have
interrupt code in the tree so they shouldn't be broken.  Sparc64 is
broken, but that's been ok'd by jake and tmm who will be fixing the
interrupt code for sparc64 shortly.

Reviewed by:	peter
Tested on:	i386, alpha
2002-01-05 08:47:13 +00:00
nyan
ddadf4ecdb Disabled the olpt driver temporarily to avoid 'repeat make_dev' panic. 2001-12-31 09:02:24 +00:00
nyan
f09046c959 MFi386: revision 1.178 2001-12-22 01:35:44 +00:00
nyan
6adab23060 MFi386: revision 1.124 2001-12-22 01:34:09 +00:00
nyan
d81e7692ac Merged from sys/dev/syscons/syscons.c revision 1.377. 2001-12-22 01:32:32 +00:00
nyan
eef8963bce cosmetic changes. 2001-12-22 01:30:19 +00:00
nyan
dfb500ec21 MFi386: revision 1.179 2001-12-22 00:38:32 +00:00
nyan
d63be1f72e MFi386: revision 1.486 2001-12-22 00:35:49 +00:00
nyan
a07a4f944b Merged from sys/isa/{fd.c,fdreg.h} revisions 1.222 and 1.15, respectively. 2001-12-16 09:00:03 +00:00
iedowse
75709290bf Enable UFS_DIRHASH in the GENERIC kernel.
Suggested by:	silby
Reviewed by:	dillon
MFC after:	5 days
2001-12-14 16:27:11 +00:00
nyan
0faafb01e6 Fixed to draw mouse cursor. The syscons driver for PC98 uses different
attributes from i386.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
MFC after:	3 days
2001-12-14 15:27:15 +00:00
nyan
f2075f1d45 MFi386: revision 1.485 (the previous commit is not completely) 2001-12-12 12:27:59 +00:00
jhb
1c79a2c04a Overhaul the per-CPU support a bit:
- The MI portions of struct globaldata have been consolidated into a MI
  struct pcpu.  The MD per-CPU data are specified via a macro defined in
  machine/pcpu.h.  A macro was chosen over a struct mdpcpu so that the
  interface would be cleaner (PCPU_GET(my_md_field) vs.
  PCPU_GET(md.md_my_md_field)).
- All references to globaldata are changed to pcpu instead.  In a UP kernel,
  this data was stored as global variables which is where the original name
  came from.  In an SMP world this data is per-CPU and ideally private to each
  CPU outside of the context of debuggers.  This also included combining
  machine/globaldata.h and machine/globals.h into machine/pcpu.h.
- The pointer to the thread using the FPU on i386 was renamed from
  npxthread to fpcurthread to be identical with other architectures.
- Make the show pcpu ddb command MI with a MD callout to display MD
  fields.
- The globaldata_register() function was renamed to pcpu_init() and now
  init's MI fields of a struct pcpu in addition to registering it with
  the internal array and list.
- A pcpu_destroy() function was added to remove a struct pcpu from the
  internal array and list.

Tested on:	alpha, i386
Reviewed by:	peter, jake
2001-12-11 23:33:44 +00:00
obrien
9f689db796 Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
dillon
462173ce40 Allow maxusers to be specified as 0 in the kernel config, which will
cause the system to auto-size to between 32 and 512 depending on the
amount of memory.

MFC after:	1 week
2001-12-09 01:57:09 +00:00
des
3f2c11b222 PROCFS requires PSEUDOFS. 2001-12-04 11:48:16 +00:00
nyan
8770493443 Split the sio driver for pc98 into bus front end and back end.
(merged from the files in sys/dev/sio)
2001-11-26 12:29:53 +00:00
nyan
c3d5f3646e MFi386: revision 1.326. 2001-11-17 13:48:31 +00:00
nyan
8317fa9a92 MFi386: revision 1.483 2001-11-17 13:16:51 +00:00
nyan
1a6ce29a0c Use make_dev_alias() instead of call make_dev() twice. 2001-11-12 13:06:04 +00:00
phk
c3a51f1df9 GC userconfig after Peter axed it 15 months ago. 2001-11-05 21:46:35 +00:00
phk
7dbff3eb30 Don't call cdevsw_add(). 2001-11-04 09:09:41 +00:00
phk
b63a001058 Rename the top 7 bits if disk minors to spare bits, rather than type bits. 2001-11-04 09:01:07 +00:00
nyan
69e1de63e6 MFi386: sys/i386/i386/machdep.c revisions 1.481 and 1.482 2001-10-30 00:53:19 +00:00
nyan
786fe54fdb Removed pmc_isa_identify function. It is not needed.
Submitted by:	takawata
2001-10-28 04:16:50 +00:00
jlemon
70fedc69f3 cn_tab no longer exists, use cnadd() to add a console device. Note that
this may result in duplicate console output in some cases.
2001-10-24 18:30:05 +00:00
nyan
20952e6eff Added the pmc driver which supports power management controller of
old NEC PC-98NOTE.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
MFC after:	1 week
2001-10-24 14:46:40 +00:00
amorita
0310ac5efc fix broken `compat_atdisk'(replace raw device name with block device's).
Reviewed by:	nyan
MFC after:	3 days
2001-10-23 09:39:09 +00:00
amorita
fae9a5e7bf Fix compile error of the case using `LINE30' option.
Reviewed by:	nyan
MFC after:	3 days
2001-10-23 08:54:50 +00:00
imp
1f68057239 First commit after a repo copy of isa/sio* -> dev/sio:
Move sio from isa/sio.c to dev/sio/sio.c.  The next step is to break
out the front end attachments, improve support for these parts on
different busses, and maybe, if we're lucky, merging in pc98 support.
It will also be MI and live in conf/files rather than files.*.

Approved by: bde
Tested with: i386, pc98
2001-10-22 02:48:38 +00:00
bde
1455602288 Use the i386 version of npx.c. It has been merged with the pc98 version.
Approved by:	nyan
Not tested by:	bde
2001-10-21 06:14:12 +00:00
mjacob
731f80846f Remove wx. 2001-10-20 18:50:31 +00:00
nyan
a573eae018 MFi386: sys/i386/isa/npx.c revisions from 1.114 to 1.116 2001-10-19 12:30:16 +00:00
nyan
e9415d13e6 Changed IO_NPXSIZE to 8 2001-10-19 12:24:45 +00:00
nyan
750a83c997 MFi386: sys/i386/isa/clock.c revision 1.177 2001-10-19 11:52:49 +00:00
nyan
1e0052ad05 MFi386: sys/i386/isa/pcaudio.c revision 1.63 2001-10-19 11:50:00 +00:00
nyan
365804abfc Merged from sys/isa/sio.c revisions from 1.344 to 1.347 2001-10-19 11:48:47 +00:00
nyan
1e787850fb MFi386: sys/i386/conf/GENERIC revision 1.320 2001-10-19 11:46:13 +00:00