Commit Graph

1940 Commits

Author SHA1 Message Date
Yoshihiro Takahashi
58823205c4 Merged from sys/isa/fd.c revision 1.228. 2002-04-06 06:43:55 +00:00
Yoshihiro Takahashi
dda7d4dcec Merged from sys/dev/sio/sio.c revisions 1.370 and 1.371. 2002-04-06 06:19:10 +00:00
John Baldwin
6008862bc2 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
Bruce Evans
79065dba2a 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
Ruslan Ermilov
12c79eb288 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
John Baldwin
c53c013bae - 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
John Baldwin
44731cab3b 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 Takenori
383519984f MFi386: revision 1.508. 2002-03-31 08:00:35 +00:00
Yoshihiro Takahashi
880d114c8a MFi386: revision 1.506. 2002-03-30 11:14:52 +00:00
KATO Takenori
f9c7a90bef MFi386: revision 1.507. 2002-03-27 11:29:40 +00:00
Matthew Dillon
d74ac6819b 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
Poul-Henning Kamp
d306122d60 Push BIO_FORMAT into a local hack inside the floppy drivers where
it belongs.
2002-03-26 19:16:37 +00:00
Yoshihiro Takahashi
9a545499fe Merged from sys/dev/sio/sio.c revisions 1.366 and 1.369. 2002-03-25 13:41:06 +00:00
Yoshihiro Takahashi
fd9fe3e748 Merged from sys/dev/syscons/syscons.c revision 1.379. 2002-03-25 13:34:37 +00:00
Yoshihiro Takahashi
2a461eb324 Fix style. 2002-03-25 12:44:03 +00:00
KATO Takenori
26b2476ba6 MFi386: revision 1.65. 2002-03-20 12:28:03 +00:00
KATO Takenori
68ee1c91c8 Remove __P. 2002-03-20 12:22:31 +00:00
KATO Takenori
237a429e22 Remove __P. 2002-03-20 11:52:56 +00:00
KATO Takenori
a3535ef8a4 MFi386: revision 1.505 (remove __P.) 2002-03-20 11:31:17 +00:00
KATO Takenori
eca3d78127 MFi386: revision 1.504. 2002-03-20 11:15:05 +00:00
KATO Takenori
881cfd8387 MFi386: revision 1.503. 2002-03-20 11:13:41 +00:00
Yoshihiro Takahashi
d679987554 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
Yoshihiro Takahashi
e454a5425b MFi386: revision 1.502 2002-03-13 13:45:00 +00:00
Yoshihiro Takahashi
369bbb548d Free allocated buffer at siodetach().
MFC after:	3 days
2002-03-10 07:22:42 +00:00
Yoshihiro Takahashi
2bc5801e8c MFi386: revision 1.501 2002-03-10 06:19:37 +00:00
Yoshihiro Takahashi
1de04d6919 - 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
Yoshihiro Takahashi
8a6d1ef4eb MFi386: revision 1.125 2002-03-08 11:38:00 +00:00
Yoshihiro Takahashi
47f470f8b5 MFi386: revision 1.498. 2002-03-02 13:19:22 +00:00
John Baldwin
a854ed9893 Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.
2002-02-27 18:32:23 +00:00
Poul-Henning Kamp
817988be19 Disksort will not "munge" requests, BIO_ORDERED or not, so remove
use of BIO_ORDERED.
2002-02-22 09:14:06 +00:00
Yoshihiro Takahashi
9090144b01 MFi386: revision 1.497 2002-02-20 05:09:57 +00:00
Yoshihiro Takahashi
aeda92b5f2 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
Yoshihiro Takahashi
9d139b79d4 - 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
Yoshihiro Takahashi
911eb59369 MFi386: revisions 1.334 and 1.335 2002-02-16 13:13:22 +00:00
Yoshihiro Takahashi
35c1f59123 MFi386: revisions 1.495 and 1.496 2002-02-16 12:59:58 +00:00
Yoshihiro Takahashi
49d069f669 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
Yoshihiro Takahashi
c02cadfe2d Cosmetic changes. 2002-02-10 10:27:37 +00:00
Yoshihiro Takahashi
cbf2d0338e - 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
Yoshihiro Takahashi
a1e56a26b3 Fixed mouse cursor on a console.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2002-02-10 10:14:39 +00:00
Yoshihiro Takahashi
4d42fb0aab MFi386: revisions 1.493 and 1.494. 2002-02-08 11:14:16 +00:00
Julian Elischer
079b7badea 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
Bruce Evans
766f247a59 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
Bruce Evans
5c8d0a85b0 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
Bruce Evans
55a9536b65 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
Yoshihiro Takahashi
593cedcce3 MFi386: revision 1.489. 2002-01-31 08:35:38 +00:00
Yoshihiro Takahashi
f9df78bb95 Changed iskanji[12] to inline functions. 2002-01-31 08:29:46 +00:00
Yoshihiro Takahashi
e523a353a2 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
Yoshihiro Takahashi
cad5db6416 MFi386: revision 1.180 2002-01-31 04:28:52 +00:00
Yoshihiro Takahashi
ae610d1fc6 MFi386: revision 1.52 2002-01-31 04:22:20 +00:00
Yoshihiro Takahashi
a31b444c96 MFi386: revision 1.64 2002-01-18 03:33:52 +00:00
Yoshihiro Takahashi
afaabc227f Merged from sys/dev/sio/sio.c revisions from 1.360 to 1.362. 2002-01-18 03:30:22 +00:00
Yoshihiro Takahashi
403eaa1e44 MFi386: revision 1.487 2002-01-18 03:28:02 +00:00
Bruce Evans
846ac2266b 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
Yoshihiro Takahashi
26449b8fd7 Merged from sys/dev/sio/sio.c revisions 1.354 and 1.358. 2002-01-06 09:54:50 +00:00
John Baldwin
c86b6ff551 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
Yoshihiro Takahashi
68eb13c9a1 Disabled the olpt driver temporarily to avoid 'repeat make_dev' panic. 2001-12-31 09:02:24 +00:00
Yoshihiro Takahashi
72e13bfb97 MFi386: revision 1.178 2001-12-22 01:35:44 +00:00
Yoshihiro Takahashi
f96a32ff7b MFi386: revision 1.124 2001-12-22 01:34:09 +00:00
Yoshihiro Takahashi
57ceceeafb Merged from sys/dev/syscons/syscons.c revision 1.377. 2001-12-22 01:32:32 +00:00
Yoshihiro Takahashi
5dcb00d324 cosmetic changes. 2001-12-22 01:30:19 +00:00
Yoshihiro Takahashi
f6145d9c69 MFi386: revision 1.179 2001-12-22 00:38:32 +00:00
Yoshihiro Takahashi
001f90205c MFi386: revision 1.486 2001-12-22 00:35:49 +00:00
Yoshihiro Takahashi
26f891b327 Merged from sys/isa/{fd.c,fdreg.h} revisions 1.222 and 1.15, respectively. 2001-12-16 09:00:03 +00:00
Ian Dowse
1cb4661d56 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
Yoshihiro Takahashi
9cc62fb3d8 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
Yoshihiro Takahashi
f169825e02 MFi386: revision 1.485 (the previous commit is not completely) 2001-12-12 12:27:59 +00:00
John Baldwin
0bbc882680 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
David E. O'Brien
6e551fb628 Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
Matthew Dillon
66a11b9fb1 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
Dag-Erling Smørgrav
88905abc3e PROCFS requires PSEUDOFS. 2001-12-04 11:48:16 +00:00
Yoshihiro Takahashi
de48920662 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
Yoshihiro Takahashi
84909fb9f2 MFi386: revision 1.326. 2001-11-17 13:48:31 +00:00
Yoshihiro Takahashi
b69802ca41 MFi386: revision 1.483 2001-11-17 13:16:51 +00:00
Yoshihiro Takahashi
6a306bf3cd Use make_dev_alias() instead of call make_dev() twice. 2001-11-12 13:06:04 +00:00
Poul-Henning Kamp
e1a7c5c881 GC userconfig after Peter axed it 15 months ago. 2001-11-05 21:46:35 +00:00
Poul-Henning Kamp
0ac42ec512 Don't call cdevsw_add(). 2001-11-04 09:09:41 +00:00
Poul-Henning Kamp
20a3b67cb2 Rename the top 7 bits if disk minors to spare bits, rather than type bits. 2001-11-04 09:01:07 +00:00
Yoshihiro Takahashi
3f64e5a6c2 MFi386: sys/i386/i386/machdep.c revisions 1.481 and 1.482 2001-10-30 00:53:19 +00:00
Yoshihiro Takahashi
32e2324497 Removed pmc_isa_identify function. It is not needed.
Submitted by:	takawata
2001-10-28 04:16:50 +00:00
Jonathan Lemon
553b79aa63 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
Yoshihiro Takahashi
6cac891491 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
Akio Morita
cfb3969378 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
Akio Morita
5f44a44380 Fix compile error of the case using `LINE30' option.
Reviewed by:	nyan
MFC after:	3 days
2001-10-23 08:54:50 +00:00
Warner Losh
d75c1b4a90 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
Bruce Evans
7dd43330b3 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
Matt Jacob
8c7c272c5a Remove wx. 2001-10-20 18:50:31 +00:00
Yoshihiro Takahashi
00da2ef3cc MFi386: sys/i386/isa/npx.c revisions from 1.114 to 1.116 2001-10-19 12:30:16 +00:00
Yoshihiro Takahashi
f89c65e5ab Changed IO_NPXSIZE to 8 2001-10-19 12:24:45 +00:00
Yoshihiro Takahashi
0886808eda MFi386: sys/i386/isa/clock.c revision 1.177 2001-10-19 11:52:49 +00:00
Yoshihiro Takahashi
0db7b6f691 MFi386: sys/i386/isa/pcaudio.c revision 1.63 2001-10-19 11:50:00 +00:00
Yoshihiro Takahashi
2e8727d53d Merged from sys/isa/sio.c revisions from 1.344 to 1.347 2001-10-19 11:48:47 +00:00
Yoshihiro Takahashi
dee072b6ba MFi386: sys/i386/conf/GENERIC revision 1.320 2001-10-19 11:46:13 +00:00
Matt Jacob
aaeac4f6c3 Make SCSI changer and SES devices standard in generic kernels.
Reviewed by:	ken@kdm.org
2001-10-16 22:22:58 +00:00
Yoshihiro Takahashi
f2eeb19063 Rewrite the pc98 bus_space stuff.
The type of bus_space_tag_t is now a pointer to bus_space_tag structure,
and the bus_space_tag structure saves pointers to functions for direct
access and relocate access.

Added bsh_bam member to the bus_space_handle structure, it saves access
method either direct access or relocate access which is called by
bus_space_* functions.

Added the mecia device support. If the bs_da and bs_ra in bus tag are set
NEPC_io_space_tag and NEPC_mem_space_tag respectively, new bus_space stuff
changes the register of mecia automatically for 16bit access.

Obtained from:	NetBSD/pc98
2001-10-07 10:04:18 +00:00
Robert Watson
e8a340cd9a o Modify pc98 syscons code to use securelevel_gt() instead of
direct variable checks.  (Yet another API to perform direct hardware I/O).

Obtained from:	TrustedBSD Project
2001-09-26 20:26:32 +00:00
Brooks Davis
2f65332817 The faith(4) device is no longer a count device so don't specify a count. 2001-09-25 18:56:40 +00:00
Yoshihiro Takahashi
17be0bb430 - Added #include <sys/systm.h>
- Cosmetic change
2001-09-24 06:41:06 +00:00
David E. O'Brien
090905a55c + Fix misplacement of `txp'
+ Document our -CURRENT debugging bits
2001-09-24 03:23:48 +00:00
Peter Wemm
eb25edbda3 Cleanup and split of nfs client and server code.
This builds on the top of several repo-copies.
2001-09-18 23:32:09 +00:00
John Baldwin
659209e636 Whitespace fixes. 2001-09-18 21:05:04 +00:00