Commit Graph

690 Commits

Author SHA1 Message Date
mux
186c547c81 Correctly set BUS_SPACE_MAXSIZE in all the busdma backends.
It was bogusly set to 64 * 1024 or 128 * 1024 because it was
bogusly reused in the BUS_DMAMAP_NSEGS definition.
2003-02-26 02:16:06 +00:00
mux
541937cf73 Cleanup of the d_mmap_t interface.
- Get rid of the useless atop() / pmap_phys_address() detour.  The
  device mmap handlers must now give back the physical address
  without atop()'ing it.
- Don't borrow the physical address of the mapping in the returned
  int.  Now we properly pass a vm_offset_t * and expect it to be
  filled by the mmap handler when the mapping was successful.  The
  mmap handler must now return 0 when successful, any other value
  is considered as an error.  Previously, returning -1 was the only
  way to fail.  This change thus accidentally fixes some devices
  which were bogusly returning errno constants which would have been
  considered as addresses by the device pager.
- Garbage collect the poorly named pmap_phys_address() now that it's
  no longer used.
- Convert all the d_mmap_t consumers to the new API.

I'm still not sure wheter we need a __FreeBSD_version bump for this,
since and we didn't guarantee API/ABI stability until 5.1-RELEASE.

Discussed with:		alc, phk, jake
Reviewed by:		peter
Compile-tested on:	LINT (i386), GENERIC (alpha and sparc64)
Runtime-tested on:	i386
2003-02-25 03:21:22 +00:00
grehan
47fb20d3f1 Catch up with ATAng changes 2003-02-24 03:12:30 +00:00
grehan
2e05ab323f Doh. Forgot to remove _KERNEL version. 2003-02-23 13:47:44 +00:00
grehan
9e23e010b0 Expose powerpc_mb() to user-space. Currently needed for atomic.h users,
this may go away in the future.
2003-02-22 22:58:13 +00:00
grehan
eeab657973 Adjust IRQ count for psim's OpenPIC model - it seems to be
off by 1.
2003-02-20 01:59:42 +00:00
grehan
24a98368c5 Catch up to latest KSE changes 2003-02-20 01:57:49 +00:00
imp
cf874b345d Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
julian
af55753a06 Move a bunch of flags from the KSE to the thread.
I was in two minds as to where to put them in the first case..
I should have listenned to the other mind.

Submitted by:	 parts by davidxu@
Reviewed by:	jeff@ mini@
2003-02-17 09:55:10 +00:00
jeff
590a39e29b - Split the struct kse into struct upcall and struct kse. struct kse will
soon be visible only to schedulers.  This greatly simplifies much the
   KSE code.

Submitted by:	davidxu
2003-02-17 05:14:26 +00:00
jeff
aa384c931f - Move ke_sticks, ke_iticks, ke_uticks, ke_uu, ke_su, and ke_iu back into
the proc.  These counters are only examined through calcru.

Submitted by:	davidxu
Tested on:	x86, alpha, UP/SMP
2003-02-17 02:19:58 +00:00
phk
4bfb37f22e Remove #include <sys/dkstat.h> 2003-02-16 14:13:23 +00:00
obrien
d386c20878 Fix whitespace problems with option lines. 2003-02-13 22:27:40 +00:00
obrien
85bd6322e6 Fix the style of the SCHED_4BSD commit. 2003-02-13 22:24:44 +00:00
grehan
99c21f7b7f Missed odd address test when transcribing the Alpha version.
This fixes the checksum problems seen with telnet.
2003-02-13 08:56:41 +00:00
mike
b4e3f2f94a Implement fpclassify():
o Add a MD header private to libc called _fpmath.h; this header
  contains bitfield layouts of MD floating-point types.
o Add a MI header private to libc called fpmath.h; this header
  contains bitfield layouts of MI floating-point types.
o Add private libc variables to lib/libc/$arch/gen/infinity.c for
  storing NaN values.
o Add __double_t and __float_t to <machine/_types.h>, and provide
  double_t and float_t typedefs in <math.h>.
o Add some C99 manifest constants (FP_ILOGB0, FP_ILOGBNAN, HUGE_VALF,
  HUGE_VALL, INFINITY, NAN, and return values for fpclassify()) to
  <math.h> and others (FLT_EVAL_METHOD, DECIMAL_DIG) to <float.h> via
  <machine/float.h>.
o Add C99 macro fpclassify() which calls __fpclassify{d,f,l}() based
  on the size of its argument.  __fpclassifyl() is never called on
  alpha because (sizeof(long double) == sizeof(double)), which is good
  since __fpclassifyl() can't deal with such a small `long double'.

This was developed by David Schultz and myself with input from bde and
fenner.

PR:		23103
Submitted by:	David Schultz <dschultz@uclink.Berkeley.EDU>
		(significant portions)
Reviewed by:	bde, fenner (earlier versions)
2003-02-08 20:37:55 +00:00
benno
28054ea687 Oops. Include opt_ddb.h. 2003-02-06 11:07:39 +00:00
benno
205fd17b03 Add a driver that attaches to the gpio node of macio and allows you to enter
DDB when the interrupt button (aka the "programmer's switch") is pressed.

This isn't unfortunately an NMI, but it's a handy way to get into DDB
quickly if needed.
2003-02-06 10:59:06 +00:00
benno
4bfbbecf11 Add a cast to silence a warning. 2003-02-06 10:47:57 +00:00
benno
ba64b35fac If a device tries to allocate an interrupt that's not on it's resource list,
assume that the child knows what it's doing and add it to the resource list.
2003-02-06 10:42:22 +00:00
benno
b5f68d4796 GC an unused variable. 2003-02-05 12:34:10 +00:00
benno
ae993b98b1 Export the ns_per_tick variable through md_var.h rather than by declaring
it extern in cpu.c.
2003-02-05 12:33:49 +00:00
benno
7bef634602 - Use cpu_setup() instead of identifycpu().
- Remove identifycpu().
2003-02-05 12:10:46 +00:00
benno
e16610544e Add cpu.c. This contains one exported function, cpu_setup(), which handles
setup of and printing information about cpus.

Obtained from:	NetBSD (parts)
2003-02-05 12:09:53 +00:00
benno
33c2dbc662 - Update spr.h
- Add hid.h

Obtained from:	NetBSD

NOTE: This undoes some changes I'd made to prefix the processor name defines
with PVR_.  This was due to my original decision to use MPC750 as a cpu name.
With this changed, the PVR_ change is no longer required.
2003-02-05 12:04:29 +00:00
benno
88bcf728ef Add an inline function wrapper for the mfpvf (Move From Processor Version
Register) instruction.
2003-02-05 11:59:27 +00:00
benno
331547882e Not all cpus are MPC750s. Replace the MPC750 cpu option with OEA. This
stands for Operating Environment Architecture and is the specification that
all of the MPC6xx, MPC7xx, MPC7xxx and IBM7xx CPUs adhere to.
2003-02-05 11:37:59 +00:00
benno
966bb12f6e Replace the inline asm in delay() with a while loop. This may not be as
efficient but it appears to actually work.  Some investigation may be
required.
2003-02-05 11:26:14 +00:00
benno
53ee945def - Rename the "powerpc" timecounter to the "decrementer" timecounter.
- Initialise it earlier.
2003-02-05 11:16:36 +00:00
harti
570156f24c Fix a problem in bus_dmamap_load_{mbuf,uio} when the first mbuf or the first
uio segment is empty. In this case no dma segment is create by
bus_dmamap_load_buffer, but the calling routine clears the first flag.
Under certain combinations of addresses of the first and second mbuf/uio
buffer this leads to corrupted DMA segment descriptors. This was already
fixed by tmm in sparc64/sparc64/iommu.c.

PR:		kern/47733
Reviewed by:	sam
Approved by:	jake (mentor)
2003-02-04 16:30:27 +00:00
jake
6b3763a173 Split statclock into statclock and profclock, and made the method for driving
statclock based on profhz when profiling is enabled MD, since most platforms
don't use this anyway.  This removes the need for statclock_process, whose
only purpose was to subdivide profhz, and gets the profiling clock running
outside of sched_lock on platforms that implement suswintr.
Also changed the interface for starting and stopping the profiling clock to
do just that, instead of changing the rate of statclock, since they can now
be separate.

Reviewed by:	jhb, tmm
Tested on:	i386, sparc64
2003-02-03 17:53:15 +00:00
benno
65f30a1a64 Add device zs to GENERIC on powerpc. 2003-02-02 06:11:23 +00:00
joe
457d099669 Put replace spaces with tabs in keeping with the rest of the file. 2003-02-01 18:45:18 +00:00
julian
e8efa7328e Reversion of commit by Davidxu plus fixes since applied.
I'm not convinced there is anything major wrong with the patch but
them's the rules..

I am using my "David's mentor" hat to revert this as he's
offline for a while.
2003-02-01 12:17:09 +00:00
benno
ad96cd6ffb - Introduce a flags value into the interrupt handler structure.
- Copy the flags passed to inthand_add into the flags value.
- If the interrupt is INTR_FAST, re-enable the irq after running the handler.
2003-02-01 07:20:36 +00:00
grehan
a7fd524f8e - add pmap_pagedaemon_waken variable
- remove dead code and fix warnings in pmap_zero_page/zero_page_area
- implement
    pmap_clear_reference
    pmap_ts_referenced
    pmap_page_exists_quick
    pmap_remove_all
- align pmap_qenter/qremove closer with i386 code
- fix vm_page locking in pmap_new_thread (from benno)
- add new parameter to pmap_clear_bit to return original
  pte value

Approved by:  benno
2003-02-01 02:56:48 +00:00
benno
1679457554 Make nirq mean 'number of irqs' and not 'last irq'. 2003-02-01 00:43:25 +00:00
benno
cd92290e8c Rework of how memory resources are discovered and dealt with in macio.
- Store the OpenFirmware "reg" property in the macio ivars.
- Use a struct to define the structure of a "reg" property entry.
- Discover all memory ranges, not just the first.
- In ata_macio, manage our own range and hand out our own allocations using
  bus_space_subregion.
- Fix bus_space_subregion to handle subregions of sparse maps.
2003-01-30 11:28:29 +00:00
benno
70310f135b Put the right fix in. Instead of deleting the declaration of __FBSDID, we
undef it before this definition.
2003-01-28 10:54:31 +00:00
benno
e0d8560e86 Back the previous commit out. It didn't actually fix the problem I was
seeing and the memory barrier isn't needed with the bridges we're using.

Fix the function style however.
2003-01-27 12:59:52 +00:00
benno
cf3eae4413 Back out some changes that snuck in with the last commit.
Pointy hat to:	benno
2003-01-27 04:32:10 +00:00
benno
a87cc2cb56 Flesh out bus_dmamap_sync. 2003-01-27 04:27:01 +00:00
benno
72fd8bd93e Use td->td_sticks, not td->td_kse->ke_sticks.
Forgotten by:	davidxu
2003-01-27 04:26:09 +00:00
benno
2521c07307 Remove a duplicate definition of the __FBSDID macro. 2003-01-27 04:24:57 +00:00
davidxu
4b9b549ca2 Move UPCALL related data structure out of kse, introduce a new
data structure called kse_upcall to manage UPCALL. All KSE binding
and loaning code are gone.

A thread owns an upcall can collect all completed syscall contexts in
its ksegrp, turn itself into UPCALL mode, and takes those contexts back
to userland. Any thread without upcall structure has to export their
contexts and exit at user boundary.

Any thread running in user mode owns an upcall structure, when it enters
kernel, if the kse mailbox's current thread pointer is not NULL, then
when the thread is blocked in kernel, a new UPCALL thread is created and
the upcall structure is transfered to the new UPCALL thread. if the kse
mailbox's current thread pointer is NULL, then when a thread is blocked
in kernel, no UPCALL thread will be created.

Each upcall always has an owner thread. Userland can remove an upcall by
calling kse_exit, when all upcalls in ksegrp are removed, the group is
atomatically shutdown. An upcall owner thread also exits when process is
in exiting state. when an owner thread exits, the upcall it owns is also
removed.

KSE is a pure scheduler entity. it represents a virtual cpu. when a thread
is running, it always has a KSE associated with it. scheduler is free to
assign a KSE to thread according thread priority, if thread priority is changed,
KSE can be moved from one thread to another.

When a ksegrp is created, there is always N KSEs created in the group. the
N is the number of physical cpu in the current system. This makes it is
possible that even an userland UTS is single CPU safe, threads in kernel still
can execute on different cpu in parallel. Userland calls kse_create to add more
upcall structures into ksegrp to increase concurrent in userland itself, kernel
is not restricted by number of upcalls userland provides.

The code hasn't been tested under SMP by author due to lack of hardware.

Reviewed by: julian
2003-01-26 11:41:35 +00:00
jeff
8d3838b535 - Introduce the SCHED_ULE and SCHED_4BSD options for compile time selection
of the scheduler.
 - Add SCHED_4BSD as the scheduler for all kernel config files in cvs.
2003-01-26 05:29:12 +00:00
grehan
4a6537effc Remove BAT invalidation. This is done later in the boot sequence,
so isn't required here, and seems to cause problems when booting
from disk.

Approved by:  benno
2003-01-22 01:47:05 +00:00
alfred
bf8e8a6e8f Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
jake
c1e42cc8bb Resolve relative relocations in klds before trying to parse the module's
metadata.  This fixes module dependency resolution by the kernel linker on
sparc64, where the relocations for the metadata are different than on other
architectures; the relative offset is in the addend of an Elf_Rela record
instead of the original value of the location being patched.
Also fix printf formats in debug code.

Submitted by:	Hartmut Brandt <brandt@fokus.gmd.de>
PR:		46732
Tested on:	alpha (obrien), i386, sparc64
2003-01-21 02:42:44 +00:00
gallatin
84ed6d1c18 include cdefs.h so as to unbreak the libc build 2003-01-20 22:05:39 +00:00
grehan
0d5519ef7a Removed unnecessary includes and brought up to date with ata
common code by adding lock functions.
2003-01-18 11:46:50 +00:00
grehan
76e3af26c7 Stub profile.h, required for userland builds.
Approved by:  Benno
2003-01-18 11:31:58 +00:00
grehan
3ccdb905db <machine/ieee.h>, taken from sparc64
Approved by:  Benno
2003-01-18 11:30:59 +00:00
grehan
75726c8985 Fix bugs with operand ordering and unnecessary sync/eieio ops. Mostly
obtained from Alpha atomic.h

Approved by:  Benno
2003-01-18 11:28:36 +00:00
grehan
9ae60db947 Allow the MD frame definition to be seen in. Required for truss/ptrace.
Approved by:  Benno
2003-01-18 11:25:21 +00:00
grehan
f683674356 RAIDframe requires LONG_BIT
Approved by:  Benno
2003-01-18 11:23:42 +00:00
grehan
022b9e97e5 Prepended underscores to macro local vars, avoiding gcc "declaration
shadows global" warning

Approved by:  benno
2003-01-18 11:20:06 +00:00
grehan
63c6d5a631 Change definition of int64 to avoid gcc3.2.1 complaints. Taken from i386
Approved by:  benno
2003-01-18 11:18:42 +00:00
dillon
aba727244c Merge all the various copies of vm_fault_quick() into a single
portable copy.
2003-01-16 00:02:21 +00:00
dillon
bd6fdb8977 Merge all the various copies of vmapbuf() and vunmapbuf() into a single
portable copy.  Note that pmap_extract() must be used instead of
pmap_kextract().

This is precursor work to a reorganization of vmapbuf() to close remaining
user/kernel races (which can lead to a panic).
2003-01-15 23:54:35 +00:00
benno
00efaa2209 Correct an off-by-one error in the calculation of the number of interrupt
resources we're managing.
2003-01-13 03:24:07 +00:00
benno
18aa48c735 Make ofw_pci_find_node() use the reg property instead of the
assigned-addresses property. This works a lot better.
2003-01-09 12:24:19 +00:00
benno
36c3989bb9 Add a pcib variant to allow us to fix up interrupt assignments.
We probably want to do something wrt bus enumeration as well at some point.
2003-01-09 12:04:18 +00:00
benno
c240e83a3c Allocate interrupts from the resource list. 2003-01-09 09:15:42 +00:00
benno
ee721e5aaa - Remove the ignore list and replace it with a quirk list of sorts.
- Add a quirk type for devices whose interrupt properties are actually
  attached to their children.
- Flag the "escc" (zs-alike serial controller) device as having this quirk.
- Rework the interrupt discovery code to deal with devices that have more than
  one interrupt.
2003-01-09 06:21:42 +00:00
grehan
7b0b5d2550 - remove unneeded includes
- fix big in use of rid for SYS_RES_IRQ
- catch up with ATA common code by adding lock function
2003-01-09 01:22:30 +00:00
grehan
444bd78ed4 Remove obsolete GEOM option, and bring diskless options up-to-date
Approved by:  benno
2003-01-09 01:09:41 +00:00
grehan
8e6417022b Add page queues locking to vunmapbuf().
Obtained from: sparc64
Approved by:  benno
2003-01-08 12:29:59 +00:00
grehan
7cefd40e0a Sync the i-cache after copying down the interrupt code
Approved by:  benno
2003-01-08 12:27:47 +00:00
grehan
4692e803ce Be more conservative about re-enabling interrupts during trap processing
until atomic issues are fully sorted.

Approved by:  benno
2003-01-08 12:20:46 +00:00
grehan
654cbff0dd Fix incorrect error returns and sign-extension.
Approved by:  benno
2003-01-08 12:19:37 +00:00
grehan
be4bc40175 Fetch the initial time from the rtc OpenFirmware node. This is a short-term
measure until the rtc h/w driver is written, and it's a lot better
than having "jan 1 1970" on filesys times.

Approved by:  benno
2003-01-08 12:17:44 +00:00
grehan
c1833e36de Remove obsolete NFS_ROOT conditional.
Approved by:  benno
2003-01-08 12:15:54 +00:00
grehan
81e5fd7cd2 Implement bus_dmamap_load_mbuf/bus_dmamap_load_uio.
Tested load_mbuf with GEM ethernet driver.

Submitted by: Hiten Pandya <hiten@unixdaemons.com> (modified by grehan)
2003-01-08 11:46:53 +00:00
grehan
3646e779b9 - define HAS_STREAM_METHODS correctly
- dmamap_load_mbuf/load_uio prototypes

Submitted partly by:  Hiten Pandya <hiten@unixdaemons.com>
2003-01-08 11:43:36 +00:00
schweikh
d3367c5f5d Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
tjr
0fa1ae4aca MB_LEN_MAX is not MD, move it to the MI limits.h. 2002-12-22 06:38:45 +00:00
julian
9868d96f1f Unbreak the KSE code. Keep track of zobie threads using the Per-CPU storage
during the context switch. Rearrange thread cleanups
to avoid problems with Giant. Clean threads when freed or
when recycled.

Approved by:	re (jhb)
2002-12-10 02:33:45 +00:00
mux
8169a213d9 Under certain circumstances, we were calling kmem_free() from
i386 cpu_thread_exit().  This resulted in a panic with WITNESS
since we need to hold Giant to call kmem_free(), and we weren't
helding it anymore in cpu_thread_exit().  We now do this from a
new MD function, cpu_thread_dtor(), called by thread_dtor().

Approved by:	re@
Suggested by:	jhb
2002-11-22 23:57:02 +00:00
deischen
31ea801074 Add getcontext, setcontext, and swapcontext as system calls.
Previously these were libc functions but were requested to
be made into system calls for atomicity and to coalesce what
might be two entrances into the kernel (signal mask setting
and floating point trap) into one.

A few style nits and comments from bde are also included.

Tested on alpha by: gallatin
2002-11-16 06:35:53 +00:00
alc
c02d224c79 Move pmap_collect() out of the machine-dependent code, rename it
to reflect its new location, and add page queue and flag locking.

Notes: (1) alpha, i386, and ia64 had identical implementations
of pmap_collect() in terms of machine-independent interfaces;
(2) sparc64 doesn't require it; (3) powerpc had it as a TODO.
2002-11-13 05:39:58 +00:00
des
4e2288959e Print real / avail memory in megabytes rather than kilobytes. 2002-11-09 16:19:14 +00:00
tmm
f740e3df9b Move the definitions of the hw.physmem, hw.usermem and hw.availpages
sysctls to MI code; this reduces code duplication and makes all of them
available on sparc64, and the latter two on powerpc.
The semantics by the i386 and pc98 hw.availpages is slightly changed:
previously, holes between ranges of available pages would be included,
while they are excluded now. The new behaviour should be more correct
and brings i386 in line with the other architectures.

Move physmem to vm/vm_init.c, where this variable is used in MI code.
2002-11-07 23:57:17 +00:00
jmallett
e1d1292908 Remove what was a temporary bogus assignment of bits of siginfo_t, as it does
not look like the prerequisites to fill it in properly will be in the tree
for the upcoming release, but it's mostly done, so there is no need for these
to stay around to remind us.
2002-11-06 14:53:35 +00:00
peter
f7fa86b743 Split 4.x and 5.x signal handling so that we can keep 4.x signal
handling clean and functional as 5.x evolves.  This allows some of the
nasty bandaids in the 5.x codepaths to be unwound.

Encapsulate 4.x signal handling under COMPAT_FREEBSD4 (there is an
anti-foot-shooting measure in place, 5.x folks need this for a while) and
finish encapsulating the older stuff under COMPAT_43.  Since the ancient
stuff is required on alpha (longjmp(3) passes a 'struct osigcontext *'
to the current sigreturn(2), instead of the 'ucontext_t *' that sigreturn
is supposed to take), add a compile time check to prevent foot shooting
there too.  Add uniform COMPAT_43 stubs for ia64/sparc64/powerpc.

Tested on: i386, alpha, ia64.  Compiled on sparc64 (a few days ago).
Approved by: re
2002-10-25 19:10:58 +00:00
grehan
0ef7fc1c4a Add the USER_SR segment register to pcb state. Initialize correctly,
and save/restore during a context switch.

The USER_SR could be overwritten when the current thread was switched
out with a faulting copyin/copyout.

Approved by: Benno
2002-10-21 05:27:41 +00:00
marcel
d35d608c07 Add two hooks to signal module load and module unload to MD code.
The primary reason for this is to allow MD code to process machine
specific attributes, segments or sections in the ELF file and
update machine specific state accordingly. An immediate use of this
is in the ia64 port where unwind information is updated to allow
debugging and tracing in/across modules. Note that this commit
does not add the functionality to the ia64 port. See revision 1.9
of ia64/ia64/elf_machdep.c.

Validated on: alpha, i386, ia64
2002-10-19 19:16:03 +00:00
rwatson
b98187d339 Permits UFS ACLs to be used with the GENERIC kernel. Due to recent
ACL configuration changes, this shouldn't result in different code paths
for file systems not explicitly configured for ACLs by the system
administrator.  For UFS1, administrators must still recompile their
kernel to add support for extended attributes; for UFS2, it's sufficient
to enable ACLs using tunefs or at mount-time (tunefs preferred for
reliability reasons).  UFS2, for a variety of reasons, including
performance and reliability, is the preferred file system for use with
ACLs.

Approved by:	re
2002-10-19 16:54:15 +00:00
peter
460da4d5cb The a.out md_coredump stuff isn't referenced anywhere anymore, and
hasn't been filled in for ages..  Nuked.
2002-10-15 00:02:50 +00:00
mike
274818ff2c Remove the P1003_1B kernel option; it is no longer used. 2002-10-13 16:29:17 +00:00
mike
0768501a2f Add standards visibility conditionals. Change any uses of sigset_t to
struct __sigset to avoid depending on objects from <sys/signal.h>.
2002-10-13 00:31:46 +00:00
mike
9da14c0f1d Add conditionals to allow va_list to be defined in other headers. 2002-10-06 22:02:06 +00:00
mike
11edf68c64 o Add conditionals to allow va_list to be defined in other headers.
o Standardize on _MACHINE_STDARG_H_ to allow multiple header includes.
o Restrict the definition of va_copy() to C99 environments.
2002-10-06 22:01:07 +00:00
grehan
ce144caffa Roll back to previous version, no need for NO_GEOM when GEOM is
standard.
2002-10-06 12:13:12 +00:00
phk
951c3e53b2 NB: This commit does *NOT* make GEOM the default in FreeBSD
NB: But it will enable it in all kernels not having options "NO_GEOM"

Put the GEOM related options into the intended order.

Add "options NO_GEOM" to all kernel configs apart from NOTES.

In some order of controlled fashion, the NO_GEOM options will be
removed, architecture by architecture in the coming days.

There are currently three known issues which may force people to
need the NO_GEOM option:

boot0cfg/fdisk:
        Tries to update the MBR while it is being used to control
        slices.  GEOM does not allow this as a direct operation.

SCSI floppy drives:
        Appearantly the scsi-da driver return "EBUSY" if no media
        is inserted.  This is wrong, it should return ENXIO.

PC98:
        It is unclear if GEOM correctly recognizes all variants of
        PC98 disklabels.  (Help Wanted!  I have neither docs nor HW)

These issues are all being worked.

Sponsored by:	DARPA & NAI Labs.
2002-10-05 16:35:33 +00:00
mike
029ec48b98 Fix namespace issues by using visibility conditionals from
<sys/cdefs.h>.
2002-10-05 05:47:56 +00:00
jmallett
0419ba230a Define _MACHINE. 2002-10-05 02:56:49 +00:00
mike
c9d55a4efc style(9) <machine/setjmp.h> headers so they look mostly the same. 2002-10-04 22:10:06 +00:00
grehan
93f545f536 Clean up ddb warnings/errors and enable in GENERIC
Approved by: benno
Motivated by: gallatin
2002-10-04 01:19:18 +00:00
grehan
40bdd697c2 - fix zero-sized stack alloc from previous commit. a default is now
selected ala sparc64
- KSEIII routines implemented (taken from i386/sparc64)

Approved by: Benno
2002-10-04 01:13:34 +00:00
scottl
3a150bca9c Some kernel threads try to do significant work, and the default KSTACK_PAGES
doesn't give them enough stack to do much before blowing away the pcb.
This adds MI and MD code to allow the allocation of an alternate kstack
who's size can be speficied when calling kthread_create.  Passing the
value 0 prevents the alternate kstack from being created.  Note that the
ia64 MD code is missing for now, and PowerPC was only partially written
due to the pmap.c being incomplete there.
Though this patch does not modify anything to make use of the alternate
kstack, acpi and usb are good candidates.

Reviewed by:	jake, peter, jhb
2002-10-02 07:44:29 +00:00
peter
1cb6a2f64f PIC_GOTOFF is OBE. 2002-09-23 07:27:45 +00:00
mike
fb4d714b00 Be careful not to define GCC-specific optimizations in the non-GCC
case.
2002-09-23 04:32:17 +00:00
benno
61bc6ef550 It's Apple GMAC, not HMAC.
Approved by:	jake (for sparc64)
2002-09-22 01:18:06 +00:00
jhb
03dc7bc4a4 Implement db_print_backtrace() if DDB is compiled into the kernel. This
MD function is just a wrapper around db_stack_trace_cmd() that prints out
a backtrace of curthread.  Currently, this function is only implemented
on i386 and alpha (and the alpha version isn't quite tested yet, will do
that in a bit).  Other changes:

- For i386, fix a bug in the raw frame address case.  The eip we extract
  from the passed in frame address does not match the frame we received.
  Thus, instead of printing a bogus frame with the wrong eip, go ahead
  and advance frame down to the same frame as the eip we are using.
- For alpha, attempt to add a way of doing a raw trace for alpha.  Instead
  of passing a frame address in 'addr', pass in a pointer to a structure
  containing PC and KSP and use those to start the backtrace.  The alpha
  db_print_backtrace() uses asm to read in the current PC and KSP values
  into such a request.

Tested on:	i386
Requested by:	many
2002-09-19 18:46:29 +00:00
grehan
01d3084ec0 Updated to somewhat match sparc64/conf/GENERIC
Approved by: benno
2002-09-19 11:20:13 +00:00
grehan
22d2979d2d Support files and a h/w tree description for the PSIM ppc simulator
Approved by: benno
2002-09-19 04:57:10 +00:00
grehan
b9926b1f0b Driver for the macio south bridge, and ATA cell contained within.
Approved by: benno
2002-09-19 04:52:07 +00:00
grehan
cca4d56e84 softc and register defs for the UniNorth chip
Approved by: benno
2002-09-19 04:50:30 +00:00
grehan
91ea6a395f - probe the UniNorth chip in addition to the PCI bridges
- enable GEM ethernet cell if present
 - allow sparse address mapping for devices

Approved by: benno
2002-09-19 04:49:58 +00:00
grehan
3c2938f17a Removed osigframe. No need for COMPAT_43 signal bin-compat in PPC.
Approved by: benno
2002-09-19 04:46:36 +00:00
grehan
a6e5f329a0 psim device support
Approved by: benno
2002-09-19 04:45:58 +00:00
grehan
acb15b8dd0 <machine/types.> -> <sys/types.h>
Approved by: benno
2002-09-19 04:45:32 +00:00
grehan
c987294fa8 Fix clearing of recoverable exception MSR bit when disabling
interrupts

Approved by: benno
2002-09-19 04:45:06 +00:00
grehan
2a3c9409d7 Additional machdep sysctl constants needed for userland utils
Approved by: benno
2002-09-19 04:44:35 +00:00
grehan
12ec2e7c5d Added sparse address support, required by the macio ATA device
Approved by: benno
2002-09-19 04:44:04 +00:00
grehan
4e75b6dbdf Fixed branch labels
Approved by: benno
2002-09-19 04:39:59 +00:00
grehan
d85d437918 - bring vm_mapbuf/unmapbuf in line with other archs
- update for recent KSE changes

Approved by: benno
2002-09-19 04:39:28 +00:00
grehan
5688c41f5d - make sure recoverable interrupts are re-enabled in the trap handler
- turn on ast() loop to enable signal delivery

Approved by: benno
2002-09-19 04:39:04 +00:00
grehan
b53c0c445d - worked around 32-bit big-endian syscall return value problem
- syscall register spills weren't copied in correctly
 - removed VM_PROT_READ from the fault type on write protect faults

Approved by: benno
2002-09-19 04:38:35 +00:00
grehan
8906347b73 Add sync before isync for G4 cpus
Obtained from: NetBSD
Approved by: benno
2002-09-19 04:37:39 +00:00
grehan
58abd18efa - use symbol for user-context offset
- fix szsigcode size declaration

Approved by: benno
2002-09-19 04:36:44 +00:00
grehan
57116e76b8 - use BAT registers to map device space and physical memory
- remove test in pmap_activate that prevented vmspace sharing (v/rfork)
 - always sync icache in pmap_enter until problems are sorted
 - fix incorrect use of regions in pmap_kenter
 - bring in pmap_release from NetBSD
 - fix overwrite of bootstrap flag in pmap_pvo_enter

Approved by: benno
2002-09-19 04:36:20 +00:00
grehan
d6ed9388d1 - psim device support
- comment out re-enabling of interrupts until problems are sorted

Approved by: benno
2002-09-19 04:32:25 +00:00
grehan
2adb6a113b Clear on-demand BAT entries to properly restore OpenFirmware's
address space

Approved by: benno
2002-09-19 04:31:39 +00:00
grehan
079bbffd71 psim device support
Approved by: benno
2002-09-19 04:31:04 +00:00
grehan
74c6147b06 - implemented sendsig/sigreturn
- sysctl for cacheline size, required by libc/rtld
 - init'd more exception vectors
 - fixed problem with register overwrite in exec_setregs
 - removed redundant NetBSD code

Approved by: benno
2002-09-19 04:30:43 +00:00
grehan
6a8e22903e - moved intrcnt/intrnames to locore.s to fix sysctl -a panic
Approved by: benno
2002-09-19 04:29:59 +00:00
grehan
2e460fc04b - rationalised includes
- added sigframe offset

Approved by: benno
2002-09-19 04:29:07 +00:00
grehan
dd1398f246 - removed unnecessary includes
- converted inline asm to C for int enable
 - shifted clearing of 'cold' to end of routine

Approved by: benno
2002-09-19 04:28:45 +00:00
mike
e35c51c74c Implement C99's va_copy() macro. 2002-09-18 07:33:16 +00:00
peter
a51c9b6627 Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00
julian
c7e9e7e892 Allocate KSEs and KSEGRPs separatly and remove them from the proc structure.
next step is to allow > 1 to be allocated per process. This would give
multi-processor threads. (when the rest of the infrastructure is
in place)

While doing this I noticed libkvm and sys/kern/kern_proc.c:fill_kinfo_proc
are diverging more than they should.. corrective action needed soon.
2002-09-15 23:52:25 +00:00
kuriyama
a61c477270 Use "options " rather than "options<tab>". 2002-09-09 02:40:59 +00:00
peter
e3b1e6d8fa Zap the implementations of the i386-aout specific cpu_coredump function.
Most of the non-i386 platforms had rather broken implementations anyway.
2002-09-07 01:26:34 +00:00
mike
8998ff49da Now that _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_ are the same on all
architectures, move the definition directly into <time.h> and finish
the removal of <machine/ansi.h>.
2002-09-03 00:06:58 +00:00
jake
ce650f8c33 Added fields for VM_MIN_ADDRESS, PS_STRINGS and stack protections to
sysentvec.  Initialized all fields of all sysentvecs, which will allow
them to be used instead of constants in more places.  Provided stack
fixup routines for emulations that previously used the default.
2002-09-01 21:41:24 +00:00
peter
385431ebc4 Take a shot at fixing up a whole stack of style and other embarresing
unforced errors that Bruce identified.  I have not yet addressed all of
his concerns.
2002-08-31 03:33:32 +00:00
peter
c3bdd669c3 Change hw.physmem and hw.usermem to unsigned long like they used to be
in the original hardwired sysctl implementation.

The buf size calculator still overflows an integer on machines with large
KVA (eg: ia64) where the number of pages does not fit into an int.  Use
'long' there.

Change Maxmem and physmem and related variables to 'long', mostly for
completeness.  Machines are not likely to overflow 'int' pages in the
near term, but then again, 640K ought to be enough for anybody.  This
comes for free on 32 bit machines, so why not?
2002-08-30 04:04:37 +00:00
jake
821a548da7 Renamed poorly named setregs to exec_setregs. Moved its prototype to
imgact.h with the other exec support functions.
2002-08-29 06:17:48 +00:00
mike
1c9e2cece8 Since arm and powerpc aren't far enough to set stathz, take a
preemptive strike and change _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_
to 128.

Approved by:	benno
2002-08-26 03:44:11 +00:00
alc
d5f256dae2 o Retire pmap_pageable(). It's an advisory routine that none
of our platforms implements.
2002-08-25 04:20:05 +00:00
mike
d541375722 Move several MI types from <machine/_types.h> to <sys/_types.h>.
These types are unlikely to ever become very MD.  They include:
clockid_t, ct_rune_t, fflags_t, intrmask_t, mbstate_t, off_t, pid_t,
rune_t, socklen_t, timer_t, wchar_t, and wint_t.

While moving them, make a few adjustments (submitted by bde):
o __ct_rune_t needs to be precisely `int', not necessarily __int32_t,
  since the arg type of the ctype functions is int.
o __rune_t, __wchar_t and __wint_t inherit this via a typedef of
  __ct_rune_t.
o Some minor wording changes in the comment blocks for ct_rune_t and
  mbstate_t.

Submitted by:	bde (partially)
2002-08-23 16:49:06 +00:00
mike
9e6f796b0d o Merge <machine/ansi.h> and <machine/types.h> into a new header
called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
  macros, which are only MD because of gratuitous differences between
  architectures.
o Change all headers to make use of this.  This mainly involves
  changing:
    #ifdef _BSD_FOO_T_
    typedef	_BSD_FOO_T_	foo_t;
    #undef _BSD_FOO_T_
    #endif
  to:
    #ifndef _FOO_T_DECLARED
    typedef	__foo_t	foo_t;
    #define	_FOO_T_DECLARED
    #endif

Concept by:	bde
Reviewed by:	jake, obrien
2002-08-21 16:20:02 +00:00
rwatson
44404e4547 In order to better support flexible and extensible access control,
make a series of modifications to the credential arguments relating
to file read and write operations to cliarfy which credential is
used for what:

- Change fo_read() and fo_write() to accept "active_cred" instead of
  "cred", and change the semantics of consumers of fo_read() and
  fo_write() to pass the active credential of the thread requesting
  an operation rather than the cached file cred.  The cached file
  cred is still available in fo_read() and fo_write() consumers
  via fp->f_cred.  These changes largely in sys_generic.c.

For each implementation of fo_read() and fo_write(), update cred
usage to reflect this change and maintain current semantics:

- badfo_readwrite() unchanged
- kqueue_read/write() unchanged
  pipe_read/write() now authorize MAC using active_cred rather
  than td->td_ucred
- soo_read/write() unchanged
- vn_read/write() now authorize MAC using active_cred but
  VOP_READ/WRITE() with fp->f_cred

Modify vn_rdwr() to accept two credential arguments instead of a
single credential: active_cred and file_cred.  Use active_cred
for MAC authorization, and select a credential for use in
VOP_READ/WRITE() based on whether file_cred is NULL or not.  If
file_cred is provided, authorize the VOP using that cred,
otherwise the active credential, matching current semantics.

Modify current vn_rdwr() consumers to pass a file_cred if used
in the context of a struct file, and to always pass active_cred.
When vn_rdwr() is used without a file_cred, pass NOCRED.

These changes should maintain current semantics for read/write,
but avoid a redundant passing of fp->f_cred, as well as making
it more clear what the origin of each credential is in file
descriptor read/write operations.

Follow-up commits will make similar changes to other file descriptor
operations, and modify the MAC framework to pass both credentials
to MAC policy modules so they can implement either semantic for
revocation.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-15 20:55:08 +00:00
alc
88f95af1ed o Introduce pmap_page_is_mapped(). Its purpose is to obsolete
the PG_MAPPED flag.
2002-08-07 19:37:22 +00:00
alc
3b63a2bd2b o Don't set PG_MAPPED or PG_WRITEABLE when a page is mapped
using pmap_kenter() or pmap_qenter().
 o Use VM_ALLOC_WIRED in pmap_new_thread().
2002-08-05 00:04:18 +00:00
blackend
9c8ad2f838 Fix the link to the Handbook 2002-08-01 17:21:18 +00:00
mike
9f0ddc464e Create a new header <machine/_stdint.h> for storing MD parts of
<stdint.h>.  Previously, parts were defined in <machine/ansi.h> and
<machine/limits.h>.  This resulted in two problems:
  (1) Defining macros in <machine/ansi.h> gets in the way of that
      header only defining types.
  (2) Defining C99 limits in <machine/limits.h> adds pollution to
      <limits.h>.
2002-07-29 17:41:23 +00:00
peter
0d8fe1f3c6 de-count pci 2002-07-23 06:38:47 +00:00