Commit Graph

282 Commits

Author SHA1 Message Date
jake
f96a367719 Rename definitions to better match the hardware wstate fields.
Don't include WSTATE_TRANSITION in WSTATE_NORMAL_MASK.
2001-12-29 07:12:30 +00:00
jake
2fa6dd41be Add definitions for TSTATE_MM_* and TSTATE_{I,X}CC_*.
Implement TSTATE_SECURE in terms of PSTATE_SECURE.
2001-12-29 07:11:00 +00:00
jake
2b14434bd9 Rename and renumber trap types to comply with the user trap types as
specified by the sparc abi.  We use numerically higher values for all
internal kernel types.
Remove soft trap types which need to be exposed to userland.  They will
move to utrap.h.
2001-12-29 07:09:50 +00:00
jake
a3769d0f6a 1. Certain tlb operations need to be atomic, so disable interrupts for
their duration.  This is still only effective as long as they are
   only used in the static kernel.  Code in modules may cause instruction
   faults which makes these break in different ways anyway.
2. Add a load bearing membar #Sync.
3. Add an inline for demapping an entire context.

Submitted by:	tmm (1, 2)
2001-12-29 07:07:35 +00:00
jake
63826f10fa jmpbuf is no longer a ucontext_t since it does not need to be passed
to sigreturn.
Add definitions for array offsets.
2001-12-29 07:03:09 +00:00
jake
a97bd61c68 Add fprs to struct fpreg. 2001-12-29 07:02:12 +00:00
jake
1483b41331 Define PSTATE_MM_MASK in terms of PSTATE_MM_SIZE.
Implement PSTATE_SECURE.
2001-12-29 07:01:34 +00:00
jake
afadfc3910 Remove pcb_y. It has moved to trapframe. 2001-12-29 07:00:30 +00:00
jake
8b50e3dd58 Don't concatentate __func__.
Make page size constants explicitly long and unsigned.
Add a macro for compile time assertions.
2001-12-29 07:00:04 +00:00
jake
a086b0a1b0 Make it clear that IH_SHIFT is expected to be that of a pointer.
Make intr_handlers an array of function pointers instead of
small structures.
2001-12-29 06:57:55 +00:00
jake
9ca32fc440 Add definitions for magic numbers used in asm.
Bloat trapframe with many extra fields so we don't need extra structures.
Use small data types where possible.
Remove second copy of TF_DONE.
Remove mmuframe.
2001-12-29 06:56:11 +00:00
jake
fc3b645fd1 Change fpblock to be an array of ints instead longs.
Change fp_init_thread to take a thread instead of a pcb so we
can get at the trapframe.
2001-12-29 06:53:19 +00:00
jake
7404706e58 Add "memory" to the clobber list for membars.
Submitted by:	tmm
2001-12-29 06:51:50 +00:00
jake
b06f1a496e Implement CLKF_USERMODE so that user time is accounted properly.
Submitted by:	tmm
2001-12-29 06:51:14 +00:00
jake
265a5e8141 Add definitions for the number of bits in the icc and xcc fields
of the ccr, as well as the shifts and masks for each.

Submitted by:	tmm
2001-12-29 06:50:25 +00:00
jake
9a06dbc23e Use ASI_P instead of ASI_N if _KERNEL isn't defined so that these
can be used in userland.

Submitted by:	tmm
2001-12-29 06:48:43 +00:00
jake
9abebb43d0 Add macros for dedicated register variables, for use in assmebler.
Add a PUTS macro.
2001-12-29 06:47:50 +00:00
jake
ea59f3f130 - Add a file for machine dependant loader metdata types. Include this in
machdep.c.
- Adapt to critical_* changes.
2001-12-23 07:02:23 +00:00
jhb
a3b98398cb Modify the critical section API as follows:
- The MD functions critical_enter/exit are renamed to start with a cpu_
  prefix.
- MI wrapper functions critical_enter/exit maintain a per-thread nesting
  count and a per-thread critical section saved state set when entering
  a critical section while at nesting level 0 and restored when exiting
  to nesting level 0.  This moves the saved state out of spin mutexes so
  that interlocking spin mutexes works properly.
- Most low-level MD code that used critical_enter/exit now use
  cpu_critical_enter/exit.  MI code such as device drivers and spin
  mutexes use the MI wrappers.  Note that since the MI wrappers store
  the state in the current thread, they do not have any return values or
  arguments.
- mtx_intr_enable() is replaced with a constant CRITICAL_FORK which is
  assigned to curthread->td_savecrit during fork_exit().

Tested on:	i386, alpha
2001-12-18 00:27:18 +00:00
jhb
21b6b26912 Overhaul the per-CPU support a bit:
- The MI portions of struct globaldata have been consolidated into a MI
  struct pcpu.  The MD per-CPU data are specified via a macro defined in
  machine/pcpu.h.  A macro was chosen over a struct mdpcpu so that the
  interface would be cleaner (PCPU_GET(my_md_field) vs.
  PCPU_GET(md.md_my_md_field)).
- All references to globaldata are changed to pcpu instead.  In a UP kernel,
  this data was stored as global variables which is where the original name
  came from.  In an SMP world this data is per-CPU and ideally private to each
  CPU outside of the context of debuggers.  This also included combining
  machine/globaldata.h and machine/globals.h into machine/pcpu.h.
- The pointer to the thread using the FPU on i386 was renamed from
  npxthread to fpcurthread to be identical with other architectures.
- Make the show pcpu ddb command MI with a MD callout to display MD
  fields.
- The globaldata_register() function was renamed to pcpu_init() and now
  init's MI fields of a struct pcpu in addition to registering it with
  the internal array and list.
- A pcpu_destroy() function was added to remove a struct pcpu from the
  internal array and list.

Tested on:	alpha, i386
Reviewed by:	peter, jake
2001-12-11 23:33:44 +00:00
obrien
e81425551e style(9) 2001-12-09 19:12:07 +00:00
mike
20cacce16c o Stop abusing MD headers with non-MD types.
o Hide nonstandard functions and types in <netinet/in.h> when
  _POSIX_SOURCE is defined.
o Add some missing types (required by POSIX.1-200x) to <netinet/in.h>.
o Restore vendor ID from Rev 1.1 in <netinet/in.h> and make use of new
  __FBSDID() macro.
o Fix some miscellaneous issues in <arpa/inet.h>.
o Correct final argument for the inet_ntop() function (POSIX.1-200x).
o Get rid of the namespace pollution from <sys/types.h> in
  <arpa/inet.h>.

Reviewed by:		fenner
Partially submitted by:	bde
2001-12-01 03:43:01 +00:00
tmm
30e94c0aed Add a structure defintion for the id prom contents.
Obtained from:	NetBSD
2001-11-18 20:50:11 +00:00
jake
c0b2cd0d3f Standardize idempotentcy ifdefs. 2001-11-18 20:30:16 +00:00
jake
41a88cc21e Add kernel headers needed to build libc. Some are bogus and/or just enough
to compile.

Mostly obtained from:	netbsd
2001-11-18 17:56:46 +00:00
jake
bb775f0c69 Make jmpbuf the same size as ucontext_t so that it can be passed
to sigreturn.

Obtained from:	alpha
2001-11-18 04:04:35 +00:00
jake
03b1e82fd5 1. Split fp.h into fp.h and fsr.h so that the latter can be included
in asm files.
2. Temporarily cause subnormal operands in floating point operations
   to be treated as zeros so that comlpetion of the operation does not
   need to be emulated.
3. Catch fp_exception_other and correctly skip over the unfinished
   instruction, but basically ignore them.  Emulating the instruction
   is not yet supported.
4. Zero td_retval[1] as well in syscall().

Submitted by:	tmm (2, 3)
2001-11-18 04:00:22 +00:00
jake
9fd727b77f 1. Remove kdbframe. Bad idea.
2. Add a TF_DONE macro, which fiddles a trapframe to make the retry on
   return from traps act like a done (advance past the trapping
   instruction instead of re-executing).
3. Flush the windows before entering the debugger, since it is no
   longer done in the breakpoint trap vector.
4. Print a warning if trace <pid> is attempted, it is not yet implemented.
5. Print traps better and decode system calls in traces.

Submitted by:	rwatson (4)
2001-11-18 03:41:12 +00:00
jake
109c8b8676 Implement SET. Set execption.s 1.12.
Submitted by:	tmm
2001-11-18 03:31:01 +00:00
jake
195f88af01 1. Convert the tstate saved in the pcb to a pstate and test for PSTATE_PEF
to determine if a process is using floating point. in order to avoid
   sign extending a 13 bit immediate.
2. We don't need to context switch cwp anymore, it is better to just
   fiddle the save tstate on return from traps.  See exception.s 1.10
   and 1.12.
3. Completely remove pcb_cwp.
4. Implement vmapbuf, vunmapbuf and vm_fault_quick.  Completely remove
   TODOs from vm_machdep.c (yay!).

Submitted by:	tmm (1, 3, 4)
Obtained from:	existing archs (4)
2001-11-18 03:28:28 +00:00
jake
03532122b2 1. Remove bootinfo and just pass loader metadata to the kernel.
2. Remove mcontext.mc_sp, it is redundant.  Adjust spare space to make
   ucontext_t a nice size.
3. Raise pil in the debugger.

Submitted by:	tmm (3)
2001-11-18 03:02:53 +00:00
jake
53d54e923a 1. Implement ascopyto() and ascopyfrom() for copying to an alternate address
space from kernel space and from an alternate address space to kernel
   space.
2. Remove the unused and unprototyped physcopy() and physzero() and replace
   with the more versatile ascopy() and aszero(), inspired by the above.
   These can be used to copy and zero physical pages of memory without mapping
   them into kernel space first.
3. Use magic numbers for the offsets in the jmpbuf structure like other
   platforms.
4. Use SET.

Submitted by: 	tmm (1, 4)
2001-11-18 02:47:26 +00:00
tmm
904109a4f9 Support for the UltraSpac DVMA MMU (IOMMU), ported from NetBSD. 2001-11-09 20:14:41 +00:00
tmm
dcba1df215 Add some OpenFirmware bus support code and definitions. 2001-11-09 20:10:55 +00:00
tmm
adebde5f2d Add bus_space and busdma support for sparc64. 2001-11-09 20:05:53 +00:00
tmm
8f24e75043 Add a nexus device for sparc64, which uses the OpenFirmware to attach UPA
devices (mostly host bridges) and handles interrupt allocation and setup.
2001-11-09 20:01:25 +00:00
tmm
30ac245755 Header file updates needed for the cache code: add/correct some ASI
definitions and add PAGE_*_MIN and -_MAX macros.
2001-11-09 19:37:52 +00:00
tmm
a688a2df13 Add cache handling code for sparc64. 2001-11-09 19:12:06 +00:00
tmm
594c8e829b Add code to emulate unimplemented (non-fp) instructions and to fixup
unaligned accesses, and instr.h, which contrains definitions for the
sparc64 instruction set (partly from NetBSD).
Make use of some definitions from instr.h in db_disasm.c.
2001-11-06 20:13:44 +00:00
tmm
ce1ebd733b Add optimized implementations of in_cksum_skip() and related functions
for sparc64.
2001-11-06 20:05:01 +00:00
mike
3df91ed4db o Add new header <sys/stdint.h>.
o Make <stdint.h> a symbolic link to <sys/stdint.h>.
o Move most of <sys/inttypes.h> into <sys/stdint.h>, as per C99.
o Remove <sys/inttypes.h>.
o Adjust includes in sys/types.h and boot/efi/include/ia64/efibind.h
  to reflect new location of integer types in <sys/stdint.h>.
o Remove previously symbolicly linked <inttypes.h>, instead create a
  new file.
o Add MD headers <machine/_inttypes.h> from NetBSD.
o Include <sys/stdint.h> in <inttypes.h>, as required by C99; and
  include <machine/_inttypes.h> in <inttypes.h>, to fill in the
  remaining requirements for <inttypes.h>.
o Add additional integer types in <machine/ansi.h> and
  <machine/limits.h> which are included via <sys/stdint.h>.

Partially obtain from:	NetBSD
Tested on:		alpha, i386
Discussed on:		freebsd-standards@bostonradio.org
Reviewed by:		bde, fenner, obrien, wollman
2001-11-02 18:05:43 +00:00
jake
889f8bad9c Implement elf_reloc. This makes klds work.
Obtained from:	netbsd
2001-10-27 07:09:40 +00:00
mike
47a3c1f5da Remove funky right justification.
Pointed out by:	bde
2001-10-23 00:42:15 +00:00
des
68ea04e864 [partially forced commit due to pilot error in earlier commit attempt]
{set,fill}_{,fp,db}regs() fixup:

 - Add dummy {set,fill}_dbregs() on architectures that don't have them.

 - KSEfy the powerpc versions (struct proc -> struct thread).

 - Some architectures had the prototypes in md_var.h, some in reg.h, and
   some in both; for consistency, move them to reg.h on all platforms.

These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
one yet.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 22:16:48 +00:00
jake
d9948593f9 Fix get_cyclecount. Wrap in ifdef _KERNEL. 2001-10-20 18:51:10 +00:00
jake
872f6c4015 Add a definition for normal kernel window state. 2001-10-20 17:08:33 +00:00
jake
0241151d04 Parameterize the size of the kernel virtual address space on KVA_PAGES.
Don't use a hard coded address constant for the virtual address of the
kernel tsb.  Allocate kernel virtual address space for the kernel tsb
at runtime.
Remove unused parameter to pmap_bootstrap.
Adapt pmap.c to use KVA_PAGES.
Map the message buffer too.
Add some traces.
Implement pmap_protect.
2001-10-20 16:17:04 +00:00
jake
cb7ca29ccf Add support for physical address hardware watchpoints. 2001-10-20 16:04:39 +00:00
jake
21fd58664d 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
c2c8a8c21a Remove traces that are loud and not that useful. Remove nested include
of ktr.h.
2001-10-20 15:58:31 +00:00
jake
c5b8016f63 Remove an unused macro arg. 2001-10-20 15:57:39 +00:00
jake
1ec51b364f Include a whole interrupt queue in struct globaldata instead of just a
pointer.  Minor style.
2001-10-20 15:57:09 +00:00
jake
be0d728a75 Add fields for boothowto and the kernel environment to boothowto. 2001-10-20 15:55:42 +00:00
obrien
e4ab2c9a0f Try two on the preprocessing logic.
Reviewed by:	ru
2001-10-19 20:01:01 +00:00
obrien
975b6d2e75 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
obrien
2b9b303646 My attempts at minimizing the number of #def's got me in trouble. 2001-10-18 16:07:21 +00:00
obrien
1d7ce16d9a 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
tmm
369a58f711 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
tmm
d2f70b2e81 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
tmm
f6584937ae 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
tmm
05eb54c2c7 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
ps
db0d5cd641 Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader
tunable.

Reviewed by:	peter
MFC after:	2 weeks
2001-10-10 23:06:54 +00:00
jake
6815a9f859 Add contents to struct *reg. 2001-09-30 19:59:07 +00:00
jake
5e37317159 Use %ver to identify the cpu instead of openfirmware.
Submitted by:	robert
2001-09-30 19:45:34 +00:00
jake
9ace52fc69 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
9f3535edc7 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
d495dd131c 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
ac0e71fb28 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
f6a5e3f810 Don't use types that require other headers. 2001-09-30 18:52:17 +00:00
jake
539ccfaeb2 Wrap hardware trap types in ifdef _kernel. 2001-09-30 18:51:18 +00:00
jake
0faa0047f4 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
de1928a0bc Don't overflow the ktr buffer <gulp>. 2001-09-30 18:42:56 +00:00
jake
327570ce60 Implement PCPU_ADDR. Align functions on 16 bytes boundaries. 2001-09-30 18:41:57 +00:00
jhb
0fc343f1d8 - 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
julian
5596676e6c 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
obrien
0e8186d4dc style(9) the structure definitions. 2001-09-05 05:18:35 +00:00
obrien
70210b8344 style(9) the structure names 2001-09-04 09:23:23 +00:00
jake
f9d393e059 Change tf_arg to uintptr_t from void * to reflect the fact that
non-pointer values may be passed in it.  Add appropriate casts.

The interrupt type is now passed in tf_arg instead tf_type.
2001-09-03 23:13:42 +00:00
jake
e317d982f6 Implement a slightly different window spill/fill algorithm for dealing
with user windows in kernel mode.  We split the windows using %otherwin,
but instead of spilling user window directly to the pcb, we attempt to
spill to user space.  If this fails because a stack page is not resident
(or the stack is smashed), the fault handler at tl 2 will detect the
situation and resume at tl 1 again where recovery code can spill to the
pcb.  Any windows that have been saved to the pcb will be copied out to
the user stack on return from kernel mode.

Add a first stab at 32 bit window handling.  This uses much of the same
recovery code as above because the alignment of the stack pointer is used
to detect 32 bit code.  Attempting to spill a 32 bit window to a 64 bit
stack, or vice versa, will cause an alignment fault.  The recovery code
then changes the window state to vector to a 32 bit spill/fill handler
and retries the faulting instruction.

Add ktr traces in useful places during trap processing.

Adjust comments to reflect new code and add many more.
2001-09-03 23:10:45 +00:00
jake
c0bffaa6e1 Move the alternate global register stack to struct globaldata. 2001-09-03 22:58:05 +00:00
jake
e6fc6fd6cd Add ktr traces. 2001-09-03 22:57:21 +00:00
jake
6ef2965afd Implement pv_bit_count which is used by pmap_ts_referenced.
Remove the modified tte bit and add a softwrite bit.  Mappings are only
writeable if they have been written to, thus in general modify just
duplicates the write bit.  The softwrite bit makes it easier to distinguish
mappings which should be writeable but are not yet modified.

Move the exec bit down one, it was being sign extended when used as an
immediate operand.

Use the lock bit to mean tsb page and remove the tsb bit.  These are the
only form of locked (tsb) entries we support and we need to conserve bits
where possible.

Implement pmap_copy_page and pmap_is_modified and friends.

Detect mappings that are being being upgraded from read-only to read-write
due to copy-on-write and update the write bit appropriately.

Make trap_mmu_fault do the right thing for protection faults, which is
necessary to implement copy on write correctly.  Also handle a bunch
more userland trap types and add ktr traces.
2001-09-03 22:55:12 +00:00
jake
2be2cb095b Implement signals. 2001-09-03 22:41:40 +00:00
jake
fa2bcfc98d Move %ver definitions from pstate.h to ver.h. Add definitions for normal
kernel pstate values, which include a memory store order override.
2001-09-03 22:36:11 +00:00
jake
9f19dd2781 Add simple macros for tracing in assembler files. There are quite
a few places where we cannot even call a function, and these have
proven to be very useful debugging tools for such situations.
2001-09-03 22:32:49 +00:00
jake
908b8f329b Use the correct copyrights. Note where most of this came from.
Requested by:	obrien
2001-09-03 22:27:23 +00:00
jake
60654f358c Bump UPAGES to 4. The pcb can be rather large. 2001-09-03 22:19:36 +00:00
jake
64bd7a7631 mtx_savecrit is a pil level, not a pstate value, thus mtx_intr_enable
was not doing its thing.
2001-09-03 22:19:04 +00:00
jake
511df0c9cd Add a flushw() macro. 2001-09-03 22:13:53 +00:00
jake
733bc35923 Add atomic_load and store functions without membars, fwiw. 2001-09-03 22:03:25 +00:00
jake
e9a17647c3 The definition for ASI_IMMU_TAG_TARGET_REG was wrong. Sort. 2001-09-03 22:02:15 +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
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
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
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
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
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
jake
a9e7523870 Add asis for interrupt registers. 2001-08-10 04:17:29 +00:00
obrien
ffdbb9dc0c 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
obrien
f202ead276 The author isn't a [UC] Regents. Correct the copyright language. 2001-08-09 02:09:34 +00:00
peter
bb5c43c4b8 Zap 'ptrace(PT_READ_U, ...)' and 'ptrace(PT_WRITE_U, ...)' since they
are a really nasty interface that should have been killed long ago
when 'ptrace(PT_[SG]ETREGS' etc came along.  The entity that they
operate on (struct user) will not be around much longer since it
is part-per-process and part-per-thread in a post-KSE world.

gdb does not actually use this except for the obscure 'info udot'
command which does a hexdump of as much of the child's 'struct user'
as it can get.  It carries its own #defines so it doesn't break
compiles.
2001-08-08 05:25:15 +00:00
jake
1fc6cd3965 The kernel runs at a much lower address now. 2001-08-06 02:24:52 +00:00
jake
8a08e4a1c6 Fix macros for dealing with tte contexts.
Add tte bits for initializing tsbs and for specifying managed mappings.
2001-08-06 02:24:18 +00:00
jake
8117bcdd30 Oops. Last commit to tsb.h should have gone here.
Fix macros for eadling with tte contexts and add macros for sfsr fields.
2001-08-06 02:21:53 +00:00
jake
9059da7a9f Fix macros for setting and extracting the context field in ttes and
add macros for the fields in sfsr.
2001-08-06 02:20:36 +00:00
jake
89093137c8 Add a vm_object and page count to struct pmap for allocating tsb pages. 2001-08-06 02:19:52 +00:00
tmm
4463b32eb5 Sigh. Add two files needed for the sparc64 fp contect switching code
that were forgotten in the last commit.

Pointy hat to: 	tmm
2001-08-05 03:47:02 +00:00
tmm
91c3a007e5 Add floating point context switching code for sparc64.
Reviewed by:	jake
2001-08-04 18:55:15 +00:00
jake
424df267d7 Move some code related to managing pv entries from the pmap module to
the pv module.  It works now that vtophys for sttes works.
2001-08-03 01:27:15 +00:00
jake
524b50ae8e Fix a bug translating virtual translation table entry addresses to physical
addresses.  It helps to use the physical address that the virtual address
actually maps to (doh!).  Comment out some code that crashes.

Found independently by:	tmm
2001-08-03 01:21:24 +00:00
jake
5b920477d4 Add an Elfhashelt type for sparc64. 2001-08-03 01:00:41 +00:00
jake
fb7edc502f Flesh out the sparc64 port considerably. This contains:
- mostly complete kernel pmap support, and tested but currently turned
  off userland pmap support
- low level assembly language trap, context switching and support code
- fully implemented atomic.h and supporting cpufunc.h
- some support for kernel debugging with ddb
- various header tweaks and filling out of machine dependent structures
2001-07-31 06:05:05 +00:00
jake
489876bc4d Add skeleton machine dependent headers and c files for a port of freebsd
to a new architecture.  This is the base of the sparc64 port, but contains
limited machine dependent code, and can be used a base for ports.  Included
are:
- standard machine dependent headers, tweaked for a 64 bit, big endian
  architecture, including empty versions of all the machine dependent
  structures
- a machine independent atomic.h, which can be used until a port has
  support for interrupts and the operations really need to be atomic
- stub versions of all the machine dependent functions, which panic
  when called and print out the name of the function that needs to
  be implemented.  functions which are normally in assembly files are
  not included, but this should reduce the number of different undefined
  references on the first few compiles from hundreds to 5 or 6
Given minimal startup code and console support it should be trivial to
make this compile and run the first few sysinits on almost any architecture.

Requested by:   alfred, imp, jhb
2001-07-31 05:45:16 +00:00