Commit Graph

76 Commits

Author SHA1 Message Date
Jake Burkholder
f2594a872e Use register g6 to point to a small stack for svaing alternate globals
during trap handlers.
Implement ptrace_set_pc FWIW.
Initialize the pcb window scratch area in setregs(), and setup user
registers as specified by the SCD.

Submitted by:	tmm
2001-08-21 00:07:37 +00:00
Jake Burkholder
0a90a07733 Handle the pcb window scratch area in cpu_fork.
Implement cpu_exit.

Submitted by:	tmm
2001-08-21 00:02:54 +00:00
Jake Burkholder
9e4ffd02dc Save and restore %fprs and %y, which are unused by kernel code, but
may be used by 32bit userland code.
Implement cpu_throw().

Submitted by:	tmm
2001-08-21 00:01:28 +00:00
Jake Burkholder
8d5e3be7a4 Disable interrupts when calling openfirmware. 2001-08-21 00:00:18 +00:00
Jake Burkholder
0839a4e34b Rename fp_init_pcb to fp_init_proc. Set the FEF bit in fprs register;
according the SCD it should be set if no user trap handler in set.

Submitted by:	tmm
2001-08-20 23:56:19 +00:00
Jake Burkholder
1f175fd0ec Add definitions for new assembler code. 2001-08-20 23:53:11 +00:00
Jake Burkholder
78d6df223d Catch up with new trap entry point names. 2001-08-20 23:51:40 +00:00
Jake Burkholder
ef3df3f0fe Add variables needed by hardware watchpoint support.
Submitted by:	tmm
2001-08-20 23:50:48 +00:00
Jake Burkholder
11676d49ba Add code for supporting hardware watch points.
Submitted by:	tmm
2001-08-20 23:50:08 +00:00
Jake Burkholder
bdb71a81f3 Add a system call trap type and syscall() call request handler.
Also add support for hardware watch point traps.

Submitted by:	tmm
2001-08-20 23:43:43 +00:00
Jake Burkholder
e2aceedd5a Add support for splitting the register windows on entry to the
kernel from usermode.  The remaining user windows are spilled
to the pcb as necessary.  The user land window fault handlers
fill directly from the pcb on return.
Add system call entry points.

Submitted by:	tmm
2001-08-20 23:40:31 +00:00
Jake Burkholder
b3ef0bf465 db_expr_t is signed. 2001-08-20 23:35:15 +00:00
Jake Burkholder
076f1c081a Add definitions for bits in condition code register and the load store
unit control registers.  Move tstate definitions to their own file.

Submitted by:	tmm
2001-08-20 23:34:46 +00:00
Jake Burkholder
2b31cfd3a0 Add a definition for the load store unit control register. 2001-08-20 23:31:41 +00:00
David E. O'Brien
c9ba45aa7a Sync globals.h up with the other platforms. There is still some cruft in
here, but now all the platforms have the same cruft.  Consistantly spell
the `struct globaldata *' "globalp".

Reviewed by:	peter
2001-08-20 21:29:16 +00:00
Jake Burkholder
8091b69762 Don't needlessly duplicate what's basically the same copyright. 2001-08-18 19:09:55 +00:00
Jake Burkholder
be30ee31a5 Implement cpu_wait(). 2001-08-18 18:11:48 +00:00
Jake Burkholder
cdc04697be Increase the size of the phys_avail memory map. Implement pmap_dispose_proc.
Turn some more potentially import functions into nops so we can do stuff
until they matter.
2001-08-18 18:11:13 +00:00
Jake Burkholder
f70bfa97c0 Spell ta 1 correctly as ta %xcc, 1. Use %pil for critical enter/exit
instead of pstate.ie.  Note that popc is not implemented in hardware
on certain ultras, so we can't use it for inline ffs (suck).
2001-08-18 18:07:37 +00:00
Jake Burkholder
cae71da765 Gcc 3.0 requires a .register pseudo-op for certain global registers when
used in assembly language.  Tell it to ignore the registers for now.
2001-08-18 18:05:24 +00:00
David E. O'Brien
589278dbae style(9) and make consistent across platforms 2001-08-16 09:29:35 +00:00
Andrey A. Chernov
2a54e09dff OFF_T -> OFF (more standard style) 2001-08-15 19:50:59 +00:00
Andrey A. Chernov
a6314641a4 Add OFF_T_MAX/OFF_T_MIN 2001-08-15 19:25:08 +00:00
David E. O'Brien
7a92dc6167 Sync up with the latest ansi.h in other platforms -- especially RUNE and
wchar bits.
2001-08-15 03:55:37 +00:00
Jake Burkholder
c64e8a395b Add a GENERIC kernel config for sparc64. 2001-08-14 03:27:02 +00:00
Jake Burkholder
05ae93afbf Add some definitions that got left out, *blush*. 2001-08-14 03:10:41 +00:00
Jake Burkholder
39f004ea89 Don't define ELF_RTLD_ADDR twice. 2001-08-14 03:09:19 +00:00
John Baldwin
688ebe120c - Close races with signals and other AST's being triggered while we are in
the process of exiting the kernel.  The ast() function now loops as long
  as the PS_ASTPENDING or PS_NEEDRESCHED flags are set.  It returns with
  preemption disabled so that any further AST's that arrive via an
  interrupt will be delayed until the low-level MD code returns to user
  mode.
- Use u_int's to store the tick counts for profiling purposes so that we
  do not need sched_lock just to read p_sticks.  This also closes a
  problem where the call to addupc_task() could screw up the arithmetic
  due to non-atomic reads of p_sticks.
- Axe need_proftick(), aston(), astoff(), astpending(), need_resched(),
  clear_resched(), and resched_wanted() in favor of direct bit operations
  on p_sflag.
- Fix up locking with sched_lock some.  In addupc_intr(), use sched_lock
  to ensure pr_addr and pr_ticks are updated atomically with setting
  PS_OWEUPC.  In ast() we clear pr_ticks atomically with clearing
  PS_OWEUPC.  We also do not grab the lock just to test a flag.
- Simplify the handling of Giant in ast() slightly.

Reviewed by:	bde (mostly)
2001-08-10 22:53:32 +00:00
Jake Burkholder
f02f55a8e3 Correct copyright language. 2001-08-10 04:51:19 +00:00
Jake Burkholder
416d9c00fa Add code to program the tick register and to setup its interrupt handler. 2001-08-10 04:49:33 +00:00
Jake Burkholder
228fa56391 Add early code to support interrupts. 2001-08-10 04:48:48 +00:00
Jake Burkholder
f69f6debc3 Fake up the frame pointers on a process's initial stack so they can be
restored correctly from the trapframe.

Submitted by:	tmm
2001-08-10 04:47:14 +00:00
Jake Burkholder
22693a0fef Handle all types of mmu misses from user mode.
Pass a context argument to tlb functions.
2001-08-10 04:44:33 +00:00
Jake Burkholder
a3698a6d7f Use the macro for getting the trap type from the trapframe.
Only set sticks (and acquire sched_lock) on entry from user mode.
Add handlers for all kinds of mmu misses, and for interrupts from
user mode.
Acquire Giant before calling into the vm system so this runs with
invariants.
Try to get the restrictions for page faults on user memory from
kernel mode right.
Only set pcb_onfault and return to the alternate return code if
this is actually a fault on user memory from kernel mode.
2001-08-10 04:43:31 +00:00
Jake Burkholder
c0eedfbccb Store 8 bytes instead of 4 in suword. Use a temporary stack that's known
to be locked in the tlb for calling openfirmware.

Submitted by:	tmm
2001-08-10 04:39:23 +00:00
Jake Burkholder
e822e0eefb Pass a context to tlb_store_slot, use a member(Sync) after setting the
secondary context register.
2001-08-10 04:37:03 +00:00
Jake Burkholder
9a6cacf3dd 1. Start the clock running early for testing.
2. Use the upcoming "tick" interface.
3. Save a call frame as well as a trap frame on proc0's initial stack.
4. Setup a pointer to the per-cpu interrupt queue.
5. Install the per-cpu pointer in interrupt and alternate globals as well.
6. Flush out setregs so exec works.

Submitted by:	tmm (3, 5, 6)
2001-08-10 04:36:00 +00:00
Jake Burkholder
346d41dd6f Set the pil to something sane on startup. 2001-08-10 04:32:13 +00:00
Jake Burkholder
4a7517d17f Add definitions needed by new assembler code. 2001-08-10 04:31:30 +00:00
Jake Burkholder
cc11501e3b 1. Add code to handle traps and interrupts from user mode.
2. Add spill and fill handlers for spills to the user stack on entry
   to the kernel.
3. Add code to handle instruction mmu misses from user mode.
4. Add code to handle level interrupts from kernel mode and vectored
   interrupt traps from either.
5. Save the pil in the trapframe on entry from kernel mode and restore
   it on return.

Submitted by:	tmm (1, 2)
2001-08-10 04:30:36 +00:00
Jake Burkholder
8dec6a681e Add code to handle stack traces that go all the way back to userland.
Use a better algorithm for finding out if an address is in the kernel.

Submitted by:	tmm
2001-08-10 04:23:41 +00:00
Jake Burkholder
8a7de3c054 Add trap types for interrupts. Ad definitions to get the interrupt level
from the trap type.
2001-08-10 04:22:24 +00:00
Jake Burkholder
fa01c0ff70 1. Add code to demap pages from the tlb for user contexts.
2. Add a context argument to most functions, instead of extracting it from
   from the tte.

Submitted by:	tmm (1).
2001-08-10 04:21:44 +00:00
Jake Burkholder
0cb2d36969 Add fields that point to per-cpu interrupt data. 2001-08-10 04:18:48 +00:00
Jake Burkholder
db6c479810 Add a field to trapframe for saving the pil. 2001-08-10 04:18:13 +00:00
Jake Burkholder
c13c9cbf4f Add asis for interrupt registers. 2001-08-10 04:17:29 +00:00
David E. O'Brien
688985be2b The author isn't a [UC] Regents. Correct the copyright language. 2001-08-09 02:32:05 +00:00
David E. O'Brien
b2d4cd8f6e Fix VCS ID spamage. 2001-08-09 02:29:32 +00:00
David E. O'Brien
d410360643 Restore the proper copyright on this and remove the gratuitous changes from
sys/alpha/include/elf.h.
2001-08-09 02:24:05 +00:00
David E. O'Brien
73a4930297 The author isn't a [UC] Regents. Correct the copyright language. 2001-08-09 02:09:34 +00:00