Commit Graph

147 Commits

Author SHA1 Message Date
Jake Burkholder
d37e05e1c4 Remove hardcoded cwp value. 2001-10-20 16:10:13 +00:00
Jake Burkholder
4daaec8bec Use KTR_PROC instead of KTR_CT1 in traces. 2001-10-20 16:09:50 +00:00
Jake Burkholder
7e16bdb39b Return zero on success from su*. Apparently no one checks the return
values.
Add traces to fubyte, subyte, etc.  These are useful for catching errors.
due to alignment since its usually not checked for by the caller.
2001-10-20 16:09:20 +00:00
Jake Burkholder
209cf80d43 Add support for physical address hardware watchpoints. 2001-10-20 16:04:39 +00:00
Jake Burkholder
6c3dcb9735 Change the stray count in struct intr_vector to a vector number that can
be used to index tables of counters.
Remove intr_dispatch() inline, it is implemented directly in tl*_intr now.
Count stray interrupts in a table of counters like intrcnt.
Disable interrupts briefly when setting up the interrupt vector table.
We must disable interrupts completely, not just raise the pil.
Pass pointers to the intr_vector structures rather than a vector number
to sched_ithd and intr_stray.
2001-10-20 16:03:41 +00:00
Jake Burkholder
44217f38a5 Remove traces that are loud and not that useful. Remove nested include
of ktr.h.
2001-10-20 15:58:31 +00:00
Jake Burkholder
c93b7ccb41 Remove an unused macro arg. 2001-10-20 15:57:39 +00:00
Jake Burkholder
4fd2757c37 Include a whole interrupt queue in struct globaldata instead of just a
pointer.  Minor style.
2001-10-20 15:57:09 +00:00
Jake Burkholder
3d6e05660a Add fields for boothowto and the kernel environment to boothowto. 2001-10-20 15:55:42 +00:00
David E. O'Brien
9f9bd82e15 Try two on the preprocessing logic.
Reviewed by:	ru
2001-10-19 20:01:01 +00:00
David E. O'Brien
4b16cf4f8a Blah, fix braino where ru had to remind me of proper preprocessor syntax.
Bad fingers, no cookie.
2001-10-19 19:17:11 +00:00
David E. O'Brien
e3ddd70789 My attempts at minimizing the number of #def's got me in trouble. 2001-10-18 16:07:21 +00:00
David E. O'Brien
4a3391b5a1 Add support for "__gnuc_va_list". Some overly "smart" libraries assume
the existence of the __gnuc_va_list type[*] because our compiler is GCC.

[*] __gnuc_va_list is defined in the GCC ginclude/stdarg.h replacement
headerwhich we don't use.
2001-10-18 00:27:39 +00:00
Thomas Moestl
84bcb99195 Add inthand_add() and inthand_remove() for use by the MD bus code and
some glue code.
2001-10-12 16:06:41 +00:00
Thomas Moestl
ccece9b5ff Fix some warnings. 2001-10-12 16:00:30 +00:00
Thomas Moestl
b6aaa482ef Save the floating point context to the right pcb in cpu_fork(), and add
an empty stub for is_physical_memory().
2001-10-12 15:58:48 +00:00
Thomas Moestl
c2f5c600c1 Make the NTOHL, NTOHS, HTONL and HTONS macros (which are nops on
sparc64) empty to avoid compiler warnings.
2001-10-12 15:55:45 +00:00
Thomas Moestl
5f19cf9309 Implement DELAY() using the %tick register. 2001-10-12 15:51:19 +00:00
Thomas Moestl
4bc38523ec Add pmap_kenter_flags(), which is used by MD bus code that will be
committed soon, add a stub form pmap_kenter_temporary(), and implement
pmap_extract() and pmap_kextract().
2001-10-12 15:49:51 +00:00
Paul Saab
cbc89bfbfe Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader
tunable.

Reviewed by:	peter
MFC after:	2 weeks
2001-10-10 23:06:54 +00:00
Dag-Erling Smørgrav
3da3249106 Dissociate ptrace from procfs.
Until now, the ptrace syscall was implemented as a wrapper that called
various functions in procfs depending on which ptrace operation was
requested.  Most of these functions were themselves wrappers around
procfs_{read,write}_{,db,fp}regs(), with only some extra error checks,
which weren't necessary in the ptrace case anyway.

This commit moves procfs_rwmem() from procfs_mem.c into sys_process.c
(renaming it to proc_rwmem() in the process), and implements ptrace()
directly in terms of procfs_{read,write}_{,db,fp}regs() instead of
having it fake up a struct uio and then call procfs_do{,db,fp}regs().

It also moves the prototypes for procfs_{read,write}_{,db,fp}regs()
and proc_rwmem() from proc.h to ptrace.h, and marks all procfs files
except procfs_machdep.c as "optional procfs" instead of "standard".
2001-10-07 20:08:42 +00:00
Jake Burkholder
fc67f24833 Add contents to struct *reg. 2001-09-30 19:59:07 +00:00
Jake Burkholder
fa753b0bcb Optimize bcopy and bzero etc to use 64 bit loads and stores if possible.
Handle overlap in bcopy.
Add routines for copying and zeroing pages using physical addresses
directly.
Remove all the hacks to account for calling the firmware on its own
trap table, we use the kernel trap table.  There is still a problem
with OF_exit().
2001-09-30 19:50:39 +00:00
Jake Burkholder
c4bc2cc714 Use %ver to identify the cpu instead of openfirmware.
Submitted by:	robert
2001-09-30 19:45:34 +00:00
Jake Burkholder
92767809a8 Remove some debug code, add traces. 2001-09-30 19:44:19 +00:00
Jake Burkholder
6b75800a1e Return EIO for procfs_*_dbregs. 2001-09-30 19:43:18 +00:00
Jake Burkholder
b34f88ee74 Add a place holder for PSTATE_SECURE, which detects if user code it
trying to set bad pstate bits.
2001-09-30 19:42:34 +00:00
Jake Burkholder
e5e8823f37 Split the low level trap code into trap, interrupt and syscall, its
easier and hopefully this code is done changing radically.

Don't use the mmu tlb register to address the kernel page table, nor
the 8k pointer register.  The hardware will do some of the page table
lookup by storing the the base address in an internal register and
calculating the address of the tte in the table.  However it is limited
to a 1 meg tsb, which only maps 512 megs.  The kernel page table only
has one level, so its easy to just do it by hand, which has the advantage
of supporting abitrary amounts of kvm and only costs a few more instructions.

Increase kvm to 1 gig now that its easy to do so and so we don't waste
most of a 4 meg page.

Fix some traces.  Fix more proc locking.

Call tsb_stte_promote if we get a soft fault on a mapping in the upper
levels of the tsb.  If there is an invalid or unreferenced mapping
in the primary tsb, it will be replaced.

Immediately fail for faults occuring in {f,s}uswintr.
2001-09-30 19:41:20 +00:00
Jake Burkholder
15b39a57a5 Implement sysarch(). 2001-09-30 19:06:45 +00:00
Jake Burkholder
c92d1bd289 Fix some traces. td->p_comm doesn't exist. 2001-09-30 19:05:30 +00:00
Jake Burkholder
956856ae06 Move the kernel to end of the first 4 gigabytes of address space, so that
one 4 meg page can map both the kernel and the openfirmware mappings.
Add the openfirmware mappings to the kernel tsb so we can call the firmware
on the kernel trap table and access kernel memory normally.
Implement pmap_swapout_proc, pmap_swapin_proc, pmap_swapout_thread,
pmap_swapin_thread, pmap_activate, pmap_page_exists, and pmap_phys_address.
2001-09-30 19:03:22 +00:00
Jake Burkholder
954f0d930e Add a macro to get the context from a tte tag, not necesarily a whole
tte.  Remove the old inline.
2001-09-30 18:55:05 +00:00
Jake Burkholder
ba0eb60597 Include <machine/setjmp.h> instead of <setjmp.h>. 2001-09-30 18:52:56 +00:00
Jake Burkholder
b71c31cefa Don't use types that require other headers. 2001-09-30 18:52:17 +00:00
Jake Burkholder
6df08a9593 Wrap hardware trap types in ifdef _kernel. 2001-09-30 18:51:18 +00:00
Jake Burkholder
18ef271232 Move the pcb the to the top of the kernel stack.
Add a guard page at the bottom of the kernel stack.  Its unclear how easy
it will be to detect these faults and do something useful.
Setup the registers on exec how the c runtime expects.
Implement various {fill,set}_*regs.
Fix proc locking.
2001-09-30 18:48:37 +00:00
Jake Burkholder
75c6786401 Don't overflow the ktr buffer <gulp>. 2001-09-30 18:42:56 +00:00
Jake Burkholder
c81f893d0c Implement PCPU_ADDR. Align functions on 16 bytes boundaries. 2001-09-30 18:41:57 +00:00
David E. O'Brien
090905a55c + Fix misplacement of `txp'
+ Document our -CURRENT debugging bits
2001-09-24 03:23:48 +00:00
Jake Burkholder
53beacfa00 Add kernbase symbol and use it instead of magic numbers in the
linker script.
2001-09-21 05:43:38 +00:00
John Baldwin
fd54558a83 - If we ever do the per-cpu KTR stuff, the index won't be volatile as it
will be private to each CPU.
- Re-style(9) the globaldata structures.  There really needs to be a MI
  struct pcpu that has a MD struct mdpcpu member at some point.
2001-09-18 21:46:26 +00:00
Peter Wemm
949224d60e Set thread0->td_pcb, this is probably why jake was getting a null deref. 2001-09-14 09:41:26 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Peter Wemm
eb30c1c0b9 Rip some well duplicated code out of cpu_wait() and cpu_exit() and move
it to the MI area.  KSE touched cpu_wait() which had the same change
replicated five ways for each platform.  Now it can just do it once.
The only MD parts seemed to be dealing with fpu state cleanup and things
like vm86 cleanup on x86.  The rest was identical.

XXX: ia64 and powerpc did not have cpu_throw(), so I've put a functional
stub in place.

Reviewed by:	jake, tmm, dillon
2001-09-10 04:28:58 +00:00
David E. O'Brien
45ae6e9aca style(9) the structure definitions. 2001-09-05 16:20:30 +00:00
David E. O'Brien
bcc9d95fe0 style(9) the structure definitions. 2001-09-05 05:18:35 +00:00
David E. O'Brien
68b0bc4fa3 style(9) the structure names 2001-09-04 09:23:23 +00:00
Peter Wemm
cfbf880deb Zap #if 0'ed map init code that got moved to the MI area.
Convert the powerpc tree to use the common code.
2001-09-04 08:42:35 +00:00
Jake Burkholder
5566cfb4db Make this compile. 2001-09-04 01:17:39 +00:00
Jake Burkholder
e94e5aae9f Remove some stale definitions and update for new assembler code. 2001-09-03 23:19:18 +00:00