Commit Graph

81 Commits

Author SHA1 Message Date
obrien
3c7a869929 + Blah, there was nothing wrong in rev 1.1 talking about the i386/NOTES.
I should have diff'ed the header with the Alpha GENERIC.
+ fix style nit
+ turn on NO_MODULES for now.
2001-09-02 23:48:37 +00:00
obrien
057bc9ceba Match the style of very other platform we have. 2001-09-02 23:37:45 +00:00
peter
89089e22c4 Converge with i386/alpha/etc pmap.c for pmap_new_proc/pmap_dispose_proc(). 2001-08-31 06:30:27 +00:00
dillon
08e732a88b Remove the MPSAFE keyword from the parser for syscalls.master.
Instead introduce the [M] prefix to existing keywords.  e.g.
MSTD is the MP SAFE version of STD.  This is prepatory for a
massive Giant lock pushdown.  The old MPSAFE keyword made
syscalls.master too messy.

Begin comments MP-Safe procedures with the comment:
/*
 * MPSAFE
 */
This comments means that the procedure may be called without
Giant held (The procedure itself may still need to obtain
Giant temporarily to do its thing).

sv_prepsyscall() is now MP SAFE and assumed to be MP SAFE
sv_transtrap() is now MP SAFE and assumed to be MP SAFE

ktrsyscall() and ktrsysret() are now MP SAFE (Giant Pushdown)
trapsignal() is now MP SAFE (Giant Pushdown)

Places which used to do the if (mtx_owned(&Giant)) mtx_unlock(&Giant)
test in syscall[2]() in */*/trap.c now do not.  Instead they
explicitly unlock Giant if they previously obtained it, and then
assert that it is no longer held to catch broken system calls.

Rebuild syscall tables.
2001-08-30 18:50:57 +00:00
mike
a45063618a o Remove some GCCisms in src/powerpc/include/endian.h.
o Unify <machine/endian.h>'s across all architectures.
o Make bswapXX() functions use a different spelling of u_int16_t and
  friends to reduce namespace pollution.  The bswapXX() functions
  don't actually exist, but we'll probably import these at some
  point.  Atleast one driver (if_de) depends on bswapXX() for big
  endian cases.
o Deprecate byteorder(3) prototypes from <sys/types.h>, these are
  now prototyped indirectly in <arpa/inet.h>.
o Deprecate in_addr_t and in_port_t typedefs in <sys/types.h>, these
  are now typedef'd in <arpa/inet.h>.
o Change byteorder(3) prototypes to use standards compliant uint32_t
  (spelled __uint32_t to reduce namespace pollution).
o Document new preferred headers and standards compliance.

Discussed with:	bde
PR:		29946
Reviewed by:	bmilekic
2001-08-30 00:04:19 +00:00
jake
d8a2be30ba 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
5fd36af7c1 Handle the pcb window scratch area in cpu_fork.
Implement cpu_exit.

Submitted by:	tmm
2001-08-21 00:02:54 +00:00
jake
da861eea01 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
e8076017f8 Disable interrupts when calling openfirmware. 2001-08-21 00:00:18 +00:00
jake
56800e0ac6 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
eed959d0e2 Add definitions for new assembler code. 2001-08-20 23:53:11 +00:00
jake
45ab2da400 Catch up with new trap entry point names. 2001-08-20 23:51:40 +00:00
jake
48bd94ad31 Add variables needed by hardware watchpoint support.
Submitted by:	tmm
2001-08-20 23:50:48 +00:00
jake
cf997765b7 Add code for supporting hardware watch points.
Submitted by:	tmm
2001-08-20 23:50:08 +00:00
jake
c5b148f1dd 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
bedeb98a21 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
0eadd1a70f db_expr_t is signed. 2001-08-20 23:35:15 +00:00
jake
df930f49e5 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
ed59961343 Add a definition for the load store unit control register. 2001-08-20 23:31:41 +00:00
obrien
355b16412a 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
bc8b09d67e Don't needlessly duplicate what's basically the same copyright. 2001-08-18 19:09:55 +00:00
jake
4a1bf71cd8 Implement cpu_wait(). 2001-08-18 18:11:48 +00:00
jake
96b13f3863 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
02952fe249 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
a0fb62c216 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
obrien
358f773cec style(9) and make consistent across platforms 2001-08-16 09:29:35 +00:00
ache
2675b7e4e4 OFF_T -> OFF (more standard style) 2001-08-15 19:50:59 +00:00
ache
77b2a90ced Add OFF_T_MAX/OFF_T_MIN 2001-08-15 19:25:08 +00:00
obrien
b72cf5b4c8 Sync up with the latest ansi.h in other platforms -- especially RUNE and
wchar bits.
2001-08-15 03:55:37 +00:00
jake
a0f57c6c47 Add a GENERIC kernel config for sparc64. 2001-08-14 03:27:02 +00:00
jake
c8f95da29a Add some definitions that got left out, *blush*. 2001-08-14 03:10:41 +00:00
jake
5f2335e67a Don't define ELF_RTLD_ADDR twice. 2001-08-14 03:09:19 +00:00
jhb
4a89454dcd - 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
a2ccfa0c6d Correct copyright language. 2001-08-10 04:51:19 +00:00
jake
cdce7694e2 Add code to program the tick register and to setup its interrupt handler. 2001-08-10 04:49:33 +00:00
jake
3aedfd6196 Add early code to support interrupts. 2001-08-10 04:48:48 +00:00
jake
ea3624730c 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
51df5872b5 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
0f671f083d 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
b6b80770d8 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
351b4d0652 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
557d27322d 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
e2dd4bc232 Set the pil to something sane on startup. 2001-08-10 04:32:13 +00:00
jake
51f9c4ea38 Add definitions needed by new assembler code. 2001-08-10 04:31:30 +00:00
jake
0c6ba3f6f4 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
02f57a4a09 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
46fd39a866 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
636a22e19d 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
bd7595b429 Add fields that point to per-cpu interrupt data. 2001-08-10 04:18:48 +00:00
jake
f49fc709ca Add a field to trapframe for saving the pil. 2001-08-10 04:18:13 +00:00