Commit Graph

188 Commits

Author SHA1 Message Date
gehenna
77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
thorpej
139cdc3125 Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.
2002-08-25 20:21:33 +00:00
thorpej
c47fa45915 Make this compile without KTRACE or SYSTRACE. 2002-08-25 18:39:40 +00:00
thorpej
88d1869bb4 No need for two copies of the i8253 register definitions. Remove the
i386-specific copy, and adjust its users to add in the timer i/o base
as necessary.
2002-08-25 18:10:32 +00:00
thorpej
3912e469dd Rename cdev_systrace_init() to cdev_clonemisc_init(), so it can
be properly used by any misc. cloning device.  While here, correct
a comment to indicate that "open" is the only entry point and that
everything else is handled with fileops.
2002-07-19 16:38:14 +00:00
fvdl
c24cb24f0d Update comment. 2002-07-14 12:30:36 +00:00
fvdl
ee925d3924 Consistently handle segment selectors in traps and interrupts. 2002-07-14 12:20:45 +00:00
fvdl
e539a84832 Since the return address is now part of struct sigframe, adjust the stack
accordingly to match alignment when copying it out.
2002-07-10 01:55:43 +00:00
fvdl
4ddf293c2e Hand-align the fxsave area to be able to determine its offset in structures
more precisely.
2002-07-10 01:54:00 +00:00
fvdl
728043f0da Add definitions for 32bit sysarch calls. 2002-07-07 23:27:00 +00:00
fvdl
c1593a7671 Implement a few 32bit sysarch calls. 2002-07-07 23:25:37 +00:00
fvdl
7cc42e6abb Move struct savefpu outside ifdef _KERNEL for the benefit of userland
code that includes <machine/pcb.h>
2002-07-06 10:43:32 +00:00
fvdl
405b1a8bb6 Add mtrr.c 2002-07-06 10:23:06 +00:00
fvdl
8b6c180747 Previous commit left a piece of old code in that would leak top-level
PTPs; remove it.
2002-07-05 16:52:39 +00:00
thorpej
011d4d5f44 Add kernel support for having userland provide the signal trampoline:
* struct sigacts gets a new sigact_sigdesc structure, which has the
  sigaction and the trampoline/version.  Version 0 means "legacy kernel
  provided trampoline".  Other versions are coordinated with machine-
  dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
  the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
  trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions.  Instead,
  sendsig() looks up the handler by peeking in the sigacts for the
  process getting the signal (since it has to look in there for the
  trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
  its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later.  Kernel
version not bumped; we will ride the 1.6C bump made recently.
2002-07-04 23:32:02 +00:00
fvdl
cf9727c9c6 Uncomment x86_64_iopl args. 2002-07-04 10:49:33 +00:00
fvdl
105d80aaa0 The double fault exception doesn't push an error. 2002-07-04 10:47:02 +00:00
fvdl
9fe7e89bfe Use a seperate stack for the double fault trap. 2002-07-04 10:46:21 +00:00
fvdl
860a1c9ae6 Enable the iopl syscall. 2002-07-04 10:44:00 +00:00
fvdl
03068e0f6f Print a little more info for unhandled traps. For the time being,
halt the CPU, don't call panic() (until DDB is done).
2002-07-04 10:42:00 +00:00
fvdl
9ec0782af4 Make this look a little more like -current i386 pmap.c 2002-07-04 10:38:26 +00:00
fvdl
4839f70ff2 Fix parameter passed to init_x86_64. 2002-07-04 10:34:22 +00:00
thorpej
e09f5065d0 During signal delivery, arrange to have the signal handler invoked
directly, using the trampoline only for the return path.
2002-06-25 01:24:49 +00:00
fvdl
0b5350133b Add MTRR support. 2002-06-18 08:35:14 +00:00
fvdl
7a777905af Make this compile again. 2002-06-18 08:34:57 +00:00
fvdl
ff5489fd50 MTRR includes. 2002-06-18 08:31:42 +00:00
fvdl
4622ad6f14 MTRR support for x86_64. Will be shared with i386 later. 2002-06-18 08:30:33 +00:00
christos
3b50728cf4 MD systrace gluons. 2002-06-17 16:32:57 +00:00
eeh
863fc84f4d Provide the correct architecture for HW_MACHINE_ARCH so things like
"sysctl -p" can tell they are in 32-bit land.
2002-06-14 18:28:19 +00:00
fvdl
c7647a1294 Fix up the FP code some, and make it deliver XMM exceptions. Adapt
sigframe a bit.
2002-06-12 19:13:27 +00:00
fvdl
a35e1a5e5b Match DIAGNOSTIC spl code in new system call entry. We may return
through the old one in the case of a 32bit exec, causing the check
to fire.
2002-06-07 00:06:21 +00:00
fvdl
c0a27f0970 Enable (empty) procfs_machdep.c 2002-06-06 15:58:23 +00:00
simonb
97f56c7642 Don't install <machine/rnd.h>. 2002-06-06 03:30:56 +00:00
fvdl
71f7cef933 Fix arglength passed to ktrsyscall for 32bit calls. 2002-06-05 22:50:08 +00:00
fvdl
39f41c9002 The intr counters are supposed to be long (==> .quad in assembler). 2002-06-05 21:59:32 +00:00
fvdl
1c3269bdc6 Change kmem access check to match the actual kva layout. 2002-06-05 21:58:30 +00:00
fvdl
18c6a6eceb Correct arg passing to ktrsyscall once again (doh). 2002-06-05 20:54:44 +00:00
fvdl
0fc3b521af Move the IDTVEC macro here, mirroring Jason's change for the i386 port. 2002-06-05 19:17:34 +00:00
fvdl
b1bff0ba73 Adapt for non-traditional cpp usage. 2002-06-05 19:16:18 +00:00
fvdl
9117c00bad Set output arch to i386:x86-64. From Jason. 2002-06-05 15:06:56 +00:00
fvdl
eb3b53295f Don't forget to put the instruction size in tf_err on system call
entry, for the sake of syscall restart.
2002-06-05 14:59:37 +00:00
fvdl
e4eac0d964 Fix rdtsc and rdpmc inlines, and fixup rnd.h to do the right thing. 2002-06-04 17:52:46 +00:00
fvdl
9c71037485 Remove all i386 host bridges, as they don't apply. Remove pchb_rndattach
call for now (may be back later).
2002-06-04 17:51:30 +00:00
fvdl
99193cfa98 Woops, pass the correct argsize to ktrsyscall. 2002-06-04 15:45:05 +00:00
fvdl
ab19cd2899 Clear P_32 on native exec (from eeh in the sparc64 port). 2002-06-04 15:44:34 +00:00
fvdl
c029f886c8 Propagate P_32 flag on fork. Use correct trampoline for 32bit return. 2002-06-04 12:58:13 +00:00
fvdl
2c7bad720d For 32bit execs, frob the stackframe to return via the old system call
return path.
2002-06-04 11:14:21 +00:00
fvdl
90c2a2ddc1 Fix up argument passing to ktr_syscall. 2002-06-04 11:12:18 +00:00
fvdl
01fbe9c413 Drink the swapgs kool-aid.
Enable the use of syscall/sysret as the default system cal entry
point.
2002-06-03 18:23:16 +00:00
fvdl
619aaa1337 Set COPTS to -O by default. 2002-06-03 18:18:43 +00:00
drochner
d2b9876081 move initialization of the "struct pglist" returned by uvm_pglistalloc()
from the calling code into uvm_pglistalloc() itself for consistency
and easier error handling
2002-06-02 14:44:35 +00:00
fvdl
cec79c16b4 Include sys/types.h or u_int* 2002-05-30 00:36:42 +00:00
fvdl
b16e023917 Enable syscall/sysret insn use. They have the potential to lead to
a faster system call path (but currently won't be much faster).
Signal trampoline to be converted.

Rename eflags -> rflags where appropriate.
2002-05-28 23:11:38 +00:00
fvdl
8b277a3d68 Add definition for CPU-private data (in a remapped page in the data
segment). Somewhat of a kludge to be able to switch stack pointers
in in the syscall entry point without clobering a register, avoiding
the terror of 'swapgs'.
2002-05-28 23:09:36 +00:00
fvdl
cfe60d7a95 Shuffle order of selectors around to appease syscall/sysret (bah). 2002-05-28 23:07:35 +00:00
fvdl
92f44882b8 rdmsr/wrmsr don't have 64 bit versions, fix the inline functions. 2002-05-28 23:06:28 +00:00
fvdl
5659e1960c Remove use of pcb_fs and pcb_gs. 2002-05-26 12:19:38 +00:00
fvdl
f6d35976a9 Remove fs and gs fields. 2002-05-26 12:08:49 +00:00
fvdl
1371b7fb28 Don't stuff fs and gs in the PCB, they need to be dealt with in
the trapframe.
2002-05-26 12:07:40 +00:00
fvdl
66f94c684f Move the kernel to the upper 4G of virtual address space and use
-mcmodel=kernel.
2002-05-26 00:23:49 +00:00
thorpej
204183c0fa * Add "pcitag_t *pba_bridgetag" to pci_attach_args. This is set to
NULL for root PCI busses.  For busses behind a bridge, it points to
  a persistent copy of the bridge's pcitag_t.  This can be very useful
  for machine-dependent PCI bus enumeration code.
* Implement a machine-dependent pci_enumerate_bus() for sparc64 which
  uses OFW device nodes to enumerate the bus.  When a PCI bus that is
  behind a bridge is attached, pci_attach_hook() allocates a new PCI
  chipset tag for the new bus and sets it's "curnode" to the OFW node
  of the bridge.  This is used as a starting point when enumerating
  that bus.  Root busses get the OFW node of the host bridge (psycho).
* Garbage-collect "ofpci" and "ofppb" from the sparc64 port.
2002-05-16 01:01:28 +00:00
thorpej
dada8613e1 Let machine-dependent code specify how to enumerate the bus.
Currently, everyone uses pci_enumerate_bus_generic().
2002-05-15 19:23:51 +00:00
jdolecek
77a65b5e56 use _KERNEL_OPT rather than _KERNEL && !_LKM 2002-05-11 09:39:25 +00:00
thorpej
510cbd8934 Revert revision 1.3. 2002-05-03 17:52:17 +00:00
eeh
be9ab3e5db Provide _LP64 definition if we are generating LP64 binaries. 2002-05-03 00:06:55 +00:00
atatat
d1b3852365 Add the INCLUDE_CONFIG_FILE option to all config files. In config
files that are generic (ie, GENERIC, GENERICSBC, GENERIC32, ALL, or
ALPHA), it is uncommented.
2002-04-25 15:06:20 +00:00
wiz
8aedc259f8 Don't cdev_decl(pms). 2002-04-19 02:10:17 +00:00
wiz
5b79e27a96 This port never even had opms -- remove line referencing it. 2002-04-18 13:18:29 +00:00
mycroft
558b4fb278 Switch from de to tlp by default. 2002-04-17 02:22:41 +00:00
thorpej
eedd94475c * Move the mii_bitbang attribute into dev/mii/files.mii
* Pull in dev/mii/files.mii from conf/files, rather than playing
  the magic "files include order" dance in N machine-dependent
  configuration definitions.
2002-04-16 20:50:16 +00:00
gmcgarry
6e066ba77a Add commented-out USERCONF option. Mainly useful for install media
and can be optionally enabled based on miniroot and ramdisk size
requirements.
2002-04-12 08:10:45 +00:00
lukem
d213d804f7 Rename MEMORY_DISK_SIZE (formerly MINIROOTSIZE) to MEMORY_DISK_ROOT_SIZE,
which was suggested by Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> as
being more consistent with what it's controlling...
2002-04-02 05:30:34 +00:00
chs
e0a7781fc7 avoid accounting errors in pmap_enter() by only updating the counters
once the operation can no longer fail.  fixes PR 16028.
2002-03-27 04:47:28 +00:00
fvdl
2f5a2ef5af Start signal stack at -128(%rsp), like the ABI specifies. 2002-03-26 15:02:42 +00:00
christos
7e277b5782 kill remaining PS_STRINGS instances. 2002-03-20 17:59:22 +00:00
atatat
31144d9976 Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command".  ERESTART is -1, which can lead to
confusion.  ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4.  No ioctl code should now return -1 anywhere.  The
ioctl() system call is now properly restartable.
2002-03-17 19:40:26 +00:00
martin
94881fb123 Rename ISDN devices, per discussion on tech-kern. The network devices
become ippp (ISDN ppp) and irip (ISDN raw IP). The character device now
are called: /dev/isdn (isdnd <-> kernel communication), /dev/isdnctl (dialing
and other control), /dev/isdntrc* (tracing), /dev/isdnbchan* (raw B channel
access, i.e. for user land PPP) and /dev/isdntel* (telephone devices, i.e.
for answering machines).
2002-03-16 16:55:51 +00:00
lukem
cd19d52695 * rename MINIROOTSIZE to MEMORY_DISK_SIZE, so that all md(4) options
are now consistently named
* fold opt_mdsize.h into opt_md.h
2002-03-10 19:56:37 +00:00
thorpej
a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
simonb
6f0fb25121 Don't need to declare phys_map - it is declared in <uvm/uvm_extern.h>. 2002-03-04 02:43:22 +00:00
simonb
4324f37586 Use "#define<tab>". 2002-02-28 03:17:23 +00:00
christos
e8116a8f5b - Use DEV_ constants, instead of documenting the numbers!
- Delete cdev_decl(mm); where appropriate, and other hand-crufting [hi powerpc!]
2002-02-27 01:20:51 +00:00
christos
6b030ee036 - define other DEV_ constants that the local port uses.
- delete cdev_decl(mm) since <sys/conf.h> does it.
2002-02-27 01:19:03 +00:00
simonb
d9ab16ba2f Purge CLSIZE, CLSIZELOG2 and MCLOFSET.
Be consistant in the way that MSIZE, MCLSHIFT, MCLBYTES and NMBCLUSTERS
  are defined.
Remove old VM constants from cesfic port.
Bump MSIZE to 256 on mipsco (the only one that wasn't already 256).
2002-02-26 15:13:19 +00:00
wiz
37e458fa45 strategy should have an 'r'. Inspired by similar change in OpenBSD. 2002-02-19 17:09:40 +00:00
simonb
2d8577fb83 Clean up some rampant code duplication wrt ieee number handling:
- Add alignment-safe double and float unions.
 - Use the above for the __infinity and __nan constants on all
   architectures that use the standard ieee754 representation of
   those constants.
 - Add a single copy of various ieee754 math functions (frexp, isinf,
   isnan, ldexp and modf) that had numerous duplicates among the
   arch-specific directories.
 - Use the above functions on all architectures where the generic C
   versions where used.  Architectures that had local assembly
   routines are untouched (for those functions only).
2002-02-19 13:08:12 +00:00
chs
b744097a5f allow writing to write-only mappings. fixes PR 3493. 2002-02-14 07:08:02 +00:00
jdolecek
6d265bd894 add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
2002-01-27 13:23:08 +00:00
fvdl
194ca09a3f Add bus_space_mmap. 2002-01-25 22:01:42 +00:00
fvdl
bd94b6db19 Add wsfont files to make building with wscons possible. 2002-01-25 22:01:12 +00:00
thorpej
0b33a64433 Add a stub procfs_machdep. 2002-01-23 19:21:42 +00:00
thorpej
122a3fe161 Re-add -mcmodel=large .. we'll just have to use a patched gcc
for now.
2002-01-22 18:57:39 +00:00
thorpej
cf6dc8e084 Update for ISA autoconfiguration changes. 2002-01-22 18:53:02 +00:00
thorpej
470bbfb229 Update for ISA autoconfiguration changes. 2002-01-22 18:36:51 +00:00
manu
5f90ae55b5 Added clockctl 2002-01-12 14:52:40 +00:00
thorpej
ac0867dd40 Add BITFIELDTYPE lint comments where we need to use u_int64_t bitfields. 2002-01-03 04:28:31 +00:00
thorpej
4eef3278dc Add casts to the __lint__ version of va_arg() to avoid dereferencing
non-pointer arguments in cases like: foo = *va_arg(ap, int *);
2002-01-03 02:05:42 +00:00
thorpej
bd95f88c7d Define __BIT_TYPES_DEFINED__. 2002-01-03 01:58:58 +00:00
thorpej
8873902707 Make gcc 3.1's preprocessor happy with the __lint__ va_end(). 2002-01-03 01:56:52 +00:00
thorpej
7efc72e894 Only use __builtin_va_list if __GNUC__. 2002-01-03 01:37:20 +00:00