Commit Graph

233 Commits

Author SHA1 Message Date
Jake Burkholder
c5297ac5da Add .register directives for gcc3.
Add some traces that can be useful but are also very loud.
Use defines for offsets into jmpbuf instead of magic numbers.
Fix a style bug.
Fixup comments.
2001-12-29 07:34:42 +00:00
Jake Burkholder
37e21e18ac Assert at compile time that structures which need to be a power of
2 really are.
Move a trace to before flushw in case it goes off the deep end.
2001-12-29 07:32:56 +00:00
Jake Burkholder
571d1e2a42 Remove a debug printf.
Setup new dedicated global register (alternate, and mmu).
Make setregs readable again.
Adapt to moving of many things into trapframe.
2001-12-29 07:28:20 +00:00
Jake Burkholder
5e857a1806 intr_handlers is an array of function pointers, not small structures.
Assert at compile time that structures which need to be a power of 2
in size really are.
2001-12-29 07:24:57 +00:00
Jake Burkholder
22a59ab32d Add .register directive for gcc3.
Enforce in hardware the non-use of floating point in the kernel.
2001-12-29 07:22:27 +00:00
Jake Burkholder
2ba03674d0 1. Make this more name space friendly (* -> emul_*).
2. Don't whine about unaligned fixups by default.
3. Adapt to removal of mmuframe.

Submitted by:	tmm (1, 2)
2001-12-29 07:20:20 +00:00
Jake Burkholder
274ee4b819 Be paranoid about the sizeof passed to db_get_value, not all trapframe
fields are u_long.
Print useful information about traps in backtraces.
GC some dead code.
2001-12-29 07:16:45 +00:00
Jake Burkholder
f5832be731 Implement dcache_inval_phys, which shoots the cache lines that correspond
to a specific physical address.  This is used for page copy and zero
routines which use physical addresses directly.

Submitted by:	tmm
2001-12-29 07:14:07 +00:00
Jake Burkholder
eddb1f8617 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 Burkholder
f9a756b838 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 Burkholder
529110b963 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 Burkholder
4339fe0983 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 Burkholder
871e39a240 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 Burkholder
65f152dbf9 Add fprs to struct fpreg. 2001-12-29 07:02:12 +00:00
Jake Burkholder
ecb8e79ca8 Define PSTATE_MM_MASK in terms of PSTATE_MM_SIZE.
Implement PSTATE_SECURE.
2001-12-29 07:01:34 +00:00
Jake Burkholder
df52646bb5 Remove pcb_y. It has moved to trapframe. 2001-12-29 07:00:30 +00:00
Jake Burkholder
ded2ba2017 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 Burkholder
dc551940fc 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 Burkholder
8c3d8ad946 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 Burkholder
5a99bf0775 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 Burkholder
f664fe9075 Add "memory" to the clobber list for membars.
Submitted by:	tmm
2001-12-29 06:51:50 +00:00
Jake Burkholder
7bb428295f Implement CLKF_USERMODE so that user time is accounted properly.
Submitted by:	tmm
2001-12-29 06:51:14 +00:00
Jake Burkholder
812a805e24 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 Burkholder
a20901cdfd 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 Burkholder
bfe6f90832 Add macros for dedicated register variables, for use in assmebler.
Add a PUTS macro.
2001-12-29 06:47:50 +00:00
Jake Burkholder
b22ed16c0b Add device ofw_console so this kernel is usable.
This commit brought to you by a sun ultra 10 running freebsd.
2001-12-29 05:58:07 +00:00
Jake Burkholder
dd80955e81 Newer versions of gcc have a bug where switch statements with only
a default: label cause a segmentation fault.  So just return EINVAL
from sysarch.
2001-12-23 07:04:05 +00:00
Jake Burkholder
c54d40ba8b - 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
Jake Burkholder
784876d773 Define our own version of abs now that we compile with -ffreestanding by
default.
2001-12-23 07:00:24 +00:00
Thomas Moestl
7a60bd5c28 Use the new rman_reserve_resource_bound() function to get boundaries
for DVMA allocations right, instead of trying to kluge around it.
Use the correct tag to pass the dmamap unload call up to. Some minor
cleanups.
2001-12-21 22:00:52 +00:00
Thomas Moestl
70527a680b Add a workaround for quirky PCI devices that set the intpin register to
0, but use this mechanism to generate interrupts.
Preserve the child device when setting up and tearing down interrupts.
Some style nits.
2001-12-21 21:35:47 +00:00
Thomas Moestl
279367f3ce Fix a bug that was indroduced while moving this code around (use the
correct length for ethernet addresses).
2001-12-21 21:31:44 +00:00
Thomas Moestl
caaed7acb7 Make the apb driver independent of the standard PCI bridge driver. 2001-12-21 21:28:54 +00:00
Thomas Moestl
7d1656b9fa Add partial support for NFS_ROOT for sparc64 (only supported in in
connection with BOOTP_NFSROOT right now).
2001-12-21 21:27:01 +00:00
John Baldwin
7e1f6dfe9d 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
John Baldwin
0bbc882680 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
David E. O'Brien
acdff873d8 style(9) 2001-12-09 19:12:07 +00:00
Matthew Dillon
66a11b9fb1 Allow maxusers to be specified as 0 in the kernel config, which will
cause the system to auto-size to between 32 and 512 depending on the
amount of memory.

MFC after:	1 week
2001-12-09 01:57:09 +00:00
Mike Barcroft
de2656d0ed 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
Thomas Moestl
f8129f72da Add a structure defintion for the id prom contents.
Obtained from:	NetBSD
2001-11-18 20:50:11 +00:00
Jake Burkholder
656ad29399 Standardize idempotentcy ifdefs. 2001-11-18 20:30:16 +00:00
Jake Burkholder
fcada3d4ed 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 Burkholder
c8d87e81dd 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 Burkholder
86f466074c 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 Burkholder
bf8f99b4b7 Avoid missing ticks and hardclock stopping.
Submitted by:	tmm
2001-11-18 03:47:30 +00:00
Jake Burkholder
a21a9d08d2 Catch up to new constants. (These commit messages should have a song.) 2001-11-18 03:45:13 +00:00
Jake Burkholder
d5a7911f4a 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 Burkholder
bc40966754 Implement SET. Set execption.s 1.12.
Submitted by:	tmm
2001-11-18 03:31:01 +00:00
Jake Burkholder
cb67f0018f 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 Burkholder
f375b739ee Implement hw.machine and hw.model sysctls.
Submitted by:	tmm
2001-11-18 03:05:56 +00:00