Commit Graph

602 Commits

Author SHA1 Message Date
jake
a780914035 - Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
  with PAE.
- Use this to represent physical addresses in the MI vm system and in the
  i386 pmap code.  This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
  detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by:	DARPA, Network Associates Laboratories
Discussed with:	re, phk (cdevsw change)
2003-03-25 00:07:06 +00:00
ru
5f25fa151f Remove bitrot associated with `maxusers'.
Submitted by:	bde
2003-03-22 14:18:23 +00:00
mux
09448722ff Use atomic operations to increment and decrement the refcount
in busdma tags.  There are currently no tags shared accross
different drivers so this isn't needed at the moment, but it
will be required when we'll have a proper newbus method to get
the parent busdma tag.
2003-03-20 19:45:26 +00:00
grehan
677b95ea64 Enable the FPU on first use per-thread and save state across context
switches. Not as lazy as it could be. Changing FPU state with sigcontext
still TODO.

fpu.c - convert some asm to inline C, and macroize fpu loads/stores
swtch.S - call out to save/restore fpu routines
trap.c - always call enable_fpu, since this shouldn't be called once
         the FPU has been enabled for a thread
genassym.c - define for pcb fpu flag
2003-03-20 10:28:20 +00:00
grehan
0b930980b1 - Add PCI ID for Paddington i/o controller, used in old G3's
- Add ID for the Intrepid i/o controller, used in new 12"/17" PowerBooks
- put IDs in chronological order
2003-03-20 10:18:01 +00:00
grehan
9be217e0b3 Add machine check handler. While generally useful, it's required when
issuing PCI config cycles on MPC106-based PowerMacs, which cause machine
checks when accessing non-existent/empty slots.
2003-03-19 08:33:21 +00:00
jake
4f8dd3b959 Made the prototypes for pmap_kenter and pmap_kremove MD. These functions
are machine dependent because they are not required to update the tlb when
mappings are added or removed, and doing so is machine dependent.
In addition, an implementation may require that pages mapped with pmap_kenter
have a backing vm_page_t, which is not necessarily true of all physical
pages, and so may choose to pass the vm_page_t to pmap_kenter instead of the
physical address in order to make this requirement clear.
2003-03-16 04:16:03 +00:00
mux
f834cef113 Grab Giant around calls to contigmalloc() and contigfree() so
that drivers converted to be MP safe don't have to deal with it.
2003-03-13 17:18:48 +00:00
jhb
96d7c30c59 Replace calls to WITNESS_SLEEP() and witness_list() with equivalent calls
to WITNESS_WARN().
2003-03-04 21:03:05 +00:00
grehan
cb570147bd Simplify ofw_pci_fixup(). It doesn't need to be recursive, since the
bridge code already handles IRQ adjustment on the far side of a bridge.

Reviewed by:  benno
2003-03-03 12:05:06 +00:00
benno
fe523d3eb8 These files are no longer used. They have been replaced with similarly named
.S files.
2003-02-28 03:35:42 +00:00
grehan
51fb3b0b03 Register typo and incorrect 32-bit constant load in previous commit.
Resulted in AST delivery not working.
2003-02-26 14:41:39 +00:00
mux
7a8bf572d5 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
aaed4e8c72 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
8e93e5266d Catch up with ATAng changes 2003-02-24 03:12:30 +00:00
grehan
798b7ebd26 Doh. Forgot to remove _KERNEL version. 2003-02-23 13:47:44 +00:00
grehan
7acd29f1d6 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
2fda3bd48b Adjust IRQ count for psim's OpenPIC model - it seems to be
off by 1.
2003-02-20 01:59:42 +00:00
grehan
e2a3993041 Catch up to latest KSE changes 2003-02-20 01:57:49 +00:00
imp
1493fd6e76 Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
julian
f9e7584a83 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
f13eb23073 - 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
0540df6168 - 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
674c779422 Remove #include <sys/dkstat.h> 2003-02-16 14:13:23 +00:00
obrien
0ac4200906 Fix whitespace problems with option lines. 2003-02-13 22:27:40 +00:00
obrien
6f4536f453 Fix the style of the SCHED_4BSD commit. 2003-02-13 22:24:44 +00:00
grehan
3685e22801 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
f24f4396dd 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
2754a27267 Oops. Include opt_ddb.h. 2003-02-06 11:07:39 +00:00
benno
199f25dcf0 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
3ef9b496be Add a cast to silence a warning. 2003-02-06 10:47:57 +00:00
benno
a2aed55ff5 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
052e4efd76 GC an unused variable. 2003-02-05 12:34:10 +00:00
benno
fc6350216a 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
a77e5e4bf6 - Use cpu_setup() instead of identifycpu().
- Remove identifycpu().
2003-02-05 12:10:46 +00:00
benno
4b1c5d6d04 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
0a6499e18c - 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
90579823ca Add an inline function wrapper for the mfpvf (Move From Processor Version
Register) instruction.
2003-02-05 11:59:27 +00:00
benno
9269bca3fb 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
a485c5b376 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
541144efba - Rename the "powerpc" timecounter to the "decrementer" timecounter.
- Initialise it earlier.
2003-02-05 11:16:36 +00:00
harti
cfabde465e 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
20c365593b 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
3d305b4fc5 Add device zs to GENERIC on powerpc. 2003-02-02 06:11:23 +00:00
joe
a979feb9c4 Put replace spaces with tabs in keeping with the rest of the file. 2003-02-01 18:45:18 +00:00
julian
51407f5934 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
443077e9da - 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
d204dfdfe6 - 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
61f626db56 Make nirq mean 'number of irqs' and not 'last irq'. 2003-02-01 00:43:25 +00:00
benno
a48adc3079 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