Commit Graph

738 Commits

Author SHA1 Message Date
thorpej 4b584bf5bb Add several more Intel cache info entries, and fetch the CFLUSH
line size if we have the CFLUSH insn.
2001-08-01 19:50:48 +00:00
thorpej ebbd9cd428 Add some more CPUID feature bits. 2001-08-01 18:47:38 +00:00
thorpej c43f8649d2 Set up function pointers for copyin/copyout in preparation for
adding optimized versions for various CPU classes/models.

Split the 386 version of copyout into a separate routine, and
add a 486 version that doesn't have the class/page-writeability
check.
2001-07-31 18:28:58 +00:00
itojun 71aa31a75a support multiple batteries (currently only # of batteris is visible -
need to tweak ioctl API more).  PR 10545.
2001-07-22 16:05:17 +00:00
wiz a9356936b4 seperate -> separate 2001-07-22 13:33:58 +00:00
thorpej babefc5331 Add BUS_DMA_READ and BUS_DMA_WRITE flags, that hint the back-end
at dmamap load time that the mapping will be used for a unidirectional
transfer of the specified direction.
2001-07-19 15:32:10 +00:00
fvdl d68e2c3f12 Redefine evil tXXX register offset defines into the trapframe structure
to use offsetof. These should be completely nuked.

Fixes math_emulate lossage.
2001-07-17 08:13:06 +00:00
thorpej 091e29f94f In i386_softintr_lock(), use splserial() rather than splhigh(),
because of splhigh() braindamage on the i386 port.

Fixes port-i386/13038 and port-i386/12985.
2001-07-16 16:53:00 +00:00
christos 825843808a add MACHO_MACHDEP_CASES 2001-07-14 03:05:51 +00:00
christos 747d93e317 new i386 files for macho and mach. 2001-07-14 02:04:25 +00:00
christos 75dabe22c7 Use global descriptor 7 for mach traps. Unfortunately this is already
used by apm 16 bit code segments so we cannot have both at the same time.
2001-07-14 02:02:45 +00:00
thorpej e26fe5cc01 Compute the VM_* constants directly, rather than hard-coding
them (with the formulas in comments).
2001-06-25 16:28:48 +00:00
wiz f3f6c5b675 `accessible' only has one `a'. 2001-06-19 12:52:20 +00:00
fvdl b4b5dc533d Add fxsr CR4 bits. 2001-06-19 09:12:49 +00:00
sommerfeld 7e7d262c34 Add %fs/%gs to trap frame and save/restore them on
trap/interrupt/syscall entry from userspace.

Remove special-case "by hand" validation of fs/gs register values as
well as special handling of them in various signal handling paths.

Now, like %ds and %es, they are validated by the hardware on return to
userland.

This paves the way for the use of %fs for per-cpu data on
multiprocessor systems, and fixes an otherwise difficult-to-fix
interaction between threads/clone(2) and USER_LDT.

Discussed in advance with Frank van der Linden.
2001-06-17 21:01:32 +00:00
thorpej 8eb3b954f1 Don't need to prototype child_return() here, it's in <sys/proc.h>. 2001-06-14 22:56:55 +00:00
simonb e5bd00e48d For ports that wire up pciide in compatibility mode, have
them define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
in pci_machdep.h and pciide_map_compat_intr() only calls
pciide_machdep_compat_intr_establish() if that preprocessor
define exists.

Ports that don't need to do this no longer need to supply a
dummy function.
2001-06-08 04:48:54 +00:00
lukem 178aeb74a0 work around lint issue (inspired by similar work in sparc port) 2001-06-07 04:44:05 +00:00
mrg 67afbd6270 use _KERNEL_OPT 2001-05-30 11:57:16 +00:00
chs 118ddca24a replace {simple_,}lock{_data,}_t with struct {simple,}lock {,*}. 2001-05-26 16:32:40 +00:00
perry c8057dc287 remove needless externs in front of function prototypes 2001-05-21 04:47:35 +00:00
thorpej 5c15afd718 Rearrange the cache info fetching code some more, and add support
for fetching cache info for AMD processors.
2001-05-03 00:35:37 +00:00
thorpej f89ed957f1 - Keep cache/tlb info in the cpu_info structure.
- Add "associativity" to the cache_info structure.
- Add a (*cpu_cacheinfo)() function pointer, like we have a
  (*cpu_setup)() function pointer.  Cache info in the `cpuid'
  is vendor-specific.
2001-05-02 21:07:01 +00:00
jdolecek 8aa43b5a54 The system configuration block structure doesn't need to be public 2001-05-02 13:16:33 +00:00
jdolecek 0b26347639 Add support for getting %es value from the bios call. 2001-05-02 13:12:45 +00:00
thorpej cf67ac7122 Per discussion w/ chuck and chuck, restructure the md page stuff
to use a structure called "vm_page_md", and use __HAVE_VM_PAGE_MD
and __HAVE_PMAP_PHYSSEG.
2001-05-01 02:19:13 +00:00
lukem b8f8cf0235 remove some lint, including ansifying some inlines 2001-04-30 01:17:30 +00:00
thorpej 2b27ac7a99 Add a VM_MDPAGE_MEMBERS macro that defines pmap-specific data for
each vm_page structure.  Add a VM_MDPAGE_INIT() macro to init this
data when pages are initialized by UVM.  These macros are mandatory,
but ports may #define them to nothing if they are not needed/used.

This deprecates struct pmap_physseg.  As a transitional measure,
allow a port to #define PMAP_PHYSSEG so that it can continue to
use it until its pmap is converted to use VM_MDPAGE_MEMBERS.

Use all this stuff to eliminate a lot of extra work in the Alpha
pmap module (it's smaller and faster now).  Changes to other pmap
modules will follow.
2001-04-29 22:44:31 +00:00
thorpej cb648add29 The idle loop page zero'er no longer needs to do uncached access
now that we have page coloring.
2001-04-29 04:42:04 +00:00
kleink fe3c9ceaf7 * Move definitions of exact-width integer types from <machine/types.h>
to <sys/types.h> and <sys/stdint.h>.
* Add a new C99 <stdint.h> header, which provides integer types of
  explicit width, related limits and integer constant macros.
* Extend <inttypes.h> to provide <stdint.h> definitions and format
  macros for printf() and scanf().
* Add C99 strtoimax() and strtoumax() functions.
* Use the latter within scanf().
* Add C99 %j, %t and %z printf()/scanf() conversions for
  intmax_t, pointer-type and size_t arguments.
2001-04-28 15:41:28 +00:00
thorpej ea0e8e69d5 Const poison. 2001-04-26 17:55:54 +00:00
kleink 99054d7a6c Add definitions for C99 fastest minimum-width integer types. 2001-04-26 16:25:19 +00:00
thorpej 5de93d4755 Move _i386_memio_unmap() into bus_machdep.c; the ACPI code wants it. 2001-04-25 03:31:23 +00:00
thorpej 69abdbf60c Undo a misguided previous change to the pmap_update() API. 2001-04-22 23:19:26 +00:00
jdolecek 912e570671 Introduce machdep mca_disk_[un]busy(), which turn on/off disk LED.
Call as appropriate from the ESDI disk driver
2001-04-22 11:52:18 +00:00
thorpej 4738622712 Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.
2001-04-22 00:33:59 +00:00
kleink f06533a1ee Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.
2001-04-15 17:13:04 +00:00
kleink 739cb75837 Add definitions of C99 specified-width integer type limits.
XXX Fastest minimum-width integer types haven't been decided upon yet.
2001-04-15 15:29:02 +00:00
kleink cdcf9f46c5 Add definitions of C99 integer constant macros.
Tidy Makefiles up a little.
2001-04-14 22:46:19 +00:00
kleink a7c20e5788 Add definitions of C99 integer constant macros. 2001-04-14 22:38:33 +00:00
kleink 7affdab52e Add definitions of C99 minimum-width and greatest-width integer types.
XXX Fastest minimum-width integer types haven't been decided upon yet.
2001-04-14 12:19:49 +00:00
thorpej 8b3fc18a1f Generic soft interrupt implementation for NetBSD/i386. This could
probably be tuned somewhat, but this is a stop-gap measure to hold
us until Bill Sommerfeld's new interrupt code comes in from the
MP branch.
2001-04-14 06:49:30 +00:00
thorpej bf2dcec4f5 Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
2001-04-13 23:29:55 +00:00
kleink 9133b51cd8 Replace the 'unsigned __COMPILER_INT64__' construct with a new name,
__COMPILER_UINT64__, to be supplied - if such a case is made, it shouldn't
be assumed that the unsigned type-specifier may be applied to it.
2001-04-12 22:01:18 +00:00
fvdl 7d1452855c Fix bus_space_write_multi_* in the memory case; the asm constraints
were wrong.
2001-04-10 12:59:32 +00:00
fvdl ecca88089a Override NFS read and write size to default to 32k for the i386 here
(can be overridden from a config file).
2001-04-02 11:48:18 +00:00
christos 728aee3ccb Some bios's when apm is disabled [or even some functions of it are disabled],
they keep giving error 0x30b. Unfortunately this keeps happening every second
making the console unusable. Keep track of the last error that occurred and
if the last 10 times apm was called the same error was returned, give up and
exit the apm thread.
2001-03-24 02:07:54 +00:00
lukem 9f60674a47 now that duplicated stuff has been moved to sys/conf.h, remove unnecessary
defs for: lpt, joy, pc
2001-03-21 23:42:14 +00:00
thorpej 2c4c690f14 Add the BUS_DMA_STREAMING flag. 2001-03-07 22:42:16 +00:00
nathanw 3862a24d20 Remove prototype for long-defunct i386_user_cleanup().
Remove duplicate prototype for i386_{set,get}_ldt() from sys_machdep.c.

Change i386_iopl() and i386_{set,get}_{ldt,ioperm}() to take a second
argument of "void *" instead of "char *", for consistency with other syscalls.
2001-02-14 01:29:45 +00:00
christos 6bf4ad97d6 appease lint: use u_int32_t and name the bit fields. 2001-02-08 17:54:43 +00:00
thorpej d85a75f583 Make sure everybody has an splvm() and equate it with splimp() (splimp()
is the historical name for this interrupt level, and the historical name
is going to go away in the near future).
2001-01-14 02:00:37 +00:00
simonb 38de3f1a70 Enable the APM_IOC_DEV_CTL ioctl. Works at least for turning off & on
a LCD screen on a Dell Inspiron 5000e (and probably many others).
2001-01-12 03:36:50 +00:00
fvdl 3947143db7 Define __HAVE_OLD_DISKLABEL in <machine/types.h> for i386 (where the
other __HAVE_* defines are). Conditionalize definition of old
disklabel struct and ODIOC* definitions on it, allowing other ports
to bump the number of partitions in the label if they want to
(see comment in sys/disklabel.h).
2001-01-07 17:55:40 +00:00
thorpej d04f6f6d57 Just garbage-collect the #if 0'd pmap_transfer() stuff. 2001-01-04 00:17:43 +00:00
fvdl 3456657259 Bump shm max pages value to a more realistic one. 2001-01-03 20:19:33 +00:00
takemura c5fd828440 replace 'long long' with int64_t to compile stand alone program with
compiler other than GCC.
2001-01-03 10:08:55 +00:00
tron 0ce4a9a0de Use highest bit of minor as an extra bit for the partition number to
bump the maximum partition number on NetBSD-i386 to 16. (Approved by fvdl)
2001-01-02 23:06:54 +00:00
thorpej bee6e31c0d Don't equate pmap_update() with tlbflush(), but instead call
tlbflush() when that's what we mean (currently everywhere, except
in the one place in MI code where it is called).

The whole pmap_update() thing needs to be reexamined, but this helps
to clarify things a little with the currently-defined semantics of
that function.
2001-01-01 22:13:53 +00:00
sommerfeld 851de295eb Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
2000-12-28 22:59:06 +00:00
itojun efa2b7073c make mbstate_t bigger (32 -> 128 bytes).
XXX if you have libc after citrus locale import, please recompile libc,
and your applications that use mbstate_t (rather rare).  really sorry
for the mess.
2000-12-26 10:35:28 +00:00
itojun 823498203f populate _BSD_MBSTATE_T_. add warning regarding to rune_t. 2000-12-21 06:03:47 +00:00
enami 5575e1f704 Print cpu features line only when corresponding part of bits are set. 2000-12-21 05:11:00 +00:00
thorpej 895f21a679 Prototype freebsd_syscall_intern() in freebsd_machdep.h so that
freebsd_exec.c has access to it.
2000-12-18 23:29:46 +00:00
mycroft e06ad67fa5 Remove ALTENTRY(). It's dangerous and should not be used. 2000-12-14 20:15:26 +00:00
tron d0de1ec852 Protect against multiple inclusion. 2000-12-11 11:39:06 +00:00
tron c6cdb692f3 Include "machine/frame.h" to avoid lint errors while building "libc". 2000-12-11 10:22:55 +00:00
mycroft f495cd9dc6 Introduce 2 new flags in types.h:
* __HAVE_SYSCALL_INTERN.  If this is defined, e_syscall is replaced by
  e_syscall_intern, which is called at key places in the kernel.  This can be
  used to set a MD syscall handler pointer.  This obsoletes and replaces the
  *_HAS_SEPARATED_SYSCALL flags.
* __HAVE_MINIMAL_EMUL.  If this is defined, certain (deprecated) elements in
  struct emul are omitted.
2000-12-11 05:28:59 +00:00
mycroft 66610a4779 Introduce PROC_PC(), which is used to get a process's user PC. If this is
defined, call addupc_intr() directly from statclock() in the system time case,
using the same P_OWEUPC path if the copyin/copyout fails.
Use this in i386 to remove profiling code from the normal userret() path.
2000-12-10 19:29:30 +00:00
jdolecek 87a6bee3a9 prototype ibcs2_syscall() in compat/ibcs2/ibcs2_exec.c 2000-12-09 12:45:44 +00:00
jdolecek 8f9b01eba1 prototype svr4_syscall() (only) in compat/svr4/svr4_exec.c 2000-12-09 12:44:26 +00:00
jdolecek 45144cbd17 put userret() into header file machine/userret.h and pull it where needed 2000-12-09 11:21:52 +00:00
mycroft 3340782619 Add a separate svr4_syscall(). 2000-12-09 06:30:54 +00:00
chs 2a95fc3517 in kvtopte(), return the mapping of the pde in the recursive page-table
mapping space rather than the mapping in the kernel address space.
2000-12-06 03:13:47 +00:00
jdolecek e9b63338d7 add prototype for ibcs2_syscall() 2000-12-02 16:13:34 +00:00
jdolecek 65203b4ec6 if IBCS2_MACHDEP_HAS_SEPARATED_SYSCALL is defined, put ibcs2_syscall to
emul_ibcs2
define IBCS2_MACHDEP_HAS_SEPARATED_SYSCALL in i386 ibcs2_machdep.h
2000-12-02 16:09:44 +00:00
soren ff0f7c1ab4 No longer used. 2000-12-01 07:56:18 +00:00
jdolecek 97669de104 make i386_nocpuid_cpus[] and i386_cpuid_cpus[] const - this pushes
another ~1.4KB to text section
2000-11-16 17:00:17 +00:00
thorpej 9298fd52fc Garbage-collect some more stuff. 2000-11-15 19:30:10 +00:00
enami 038ca0a146 Make isa_machdep.c compile again. 2000-11-15 02:00:31 +00:00
thorpej 10b31e1ebc The i386 page size is fixed -- override PAGE_SIZE, et al, so that they
are compile-time constants.
2000-11-14 18:01:54 +00:00
kim 534a2fa4bb BIOS memory loading messages can be enabled with DEBUG_MEMLOAD.
Increase VM_PHYSSEG_MAX from 3 to 5 to avoid a panic.  Suggest
increasing VM_PHYSSEG_MAX in the panic message.
2000-11-09 17:34:51 +00:00
thorpej c60d6ae15b Machine pmc.h 2000-11-05 22:28:00 +00:00
fvdl 2e6f523813 Bump CPU_MAXFAMILY to 7. 2000-09-29 14:17:17 +00:00
is f41561e9de We do wired page accounting. Tell UVM about it. 2000-09-28 13:09:10 +00:00
thorpej b008f5f25a Make PMAP_PAGEIDLEZERO() return a boolean value. FALSE indidcates
that the page being zero'd was not completed and that page zeroing
should be aborted.  This may be used by machine-dependent code doing
slow page access to reduce the latency of running a process that has
become runnable while in the middle of doing a slow page zero.
2000-09-21 17:46:04 +00:00
fvdl 76e330bdb3 Fix typo. 2000-09-20 22:59:44 +00:00
fvdl 082a77ccfe Bring the default value of NMBCLUSTERS into the modern age. 2000-09-19 22:21:54 +00:00
thorpej 90a2e46ab1 Add support for using the 586- and 686-class performance
counters.
2000-09-13 04:47:00 +00:00
thorpej b9b07590ec Define some 586-class CESR MSR bits. 2000-09-13 04:44:27 +00:00
thorpej e2cc69026a Add 686-class performance counter events. 2000-09-13 03:37:04 +00:00
thorpej a68986edfc Add optional support for mapping the kernel with large (4MB) pages.
Right now, only does kernel text, and wastes a little memory, but
there is some noticeable performance improvement even with just text.
2000-09-07 17:20:58 +00:00
thorpej fbc40806dd vtopte() and kvtopte() now check for kernel vs. non-kernel addresses,
respectively.
2000-09-06 23:32:13 +00:00
thorpej 7dd395bb7f Remove some vto*() macros that won't stand a chance of working
with PSE or PAE, and reimplement vtphys() in terms of pmap_extract().
2000-09-06 19:09:45 +00:00
thorpej 7683d3f956 Define PG_LGFRAME, which is the page frame mask for large (4MB) pages. 2000-09-05 21:52:16 +00:00
thorpej 4db6fc7542 Make need_resched() take a "struct cpu_info *" argument. This
causes gives a primitive form of processor affinity.  Its use in
roundrobin() still needs some work.
2000-08-25 01:04:06 +00:00
thorpej 58e7a6954b Add spllock(). See spl(9) for details. 2000-08-22 19:46:26 +00:00
thorpej 23a7f255d4 Make sure we provide splsched() as described in spl(9). 2000-08-21 02:06:31 +00:00
thorpej b0dc085df7 Move the TSS selector out of the PCB and put it into mdproc. We
need to access this when we have the proclist locked for reading,
and thus cannot store it in the PCB (which may be swapped out).

As part of this, call pmap_activate() from cpu_switch() to switch
to the new address space, and refresh the PCB's copy of the LDT
selector from the pmap structure (see above paragraph).  We need
to do this for MP support anyhow.

Fixes a "panic: spinlock_switchcheck: CPU 0 has 1 spin locks" via
gdt_compact() reported by Nathan Williams.
2000-08-16 04:44:35 +00:00
christos cabafb6c60 cast to u_long before casting to u_int to appease lint. 2000-08-13 22:45:01 +00:00