summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/include
Commit message (Collapse)AuthorAgeFilesLines
* - Fix for sparc64 to use new __panic() functionkensmith2004-01-271-2/+4
| | | | | | Adapted from patch by: David Cornejo <dcornejo@firetide.com> Reviewed by: freebsd-sparc64 (harti) Approved by: rwatson (mentor)
* Provide sysarch(2) prototypes in the MD sysarch.h headers. While I'mnectar2004-01-091-0/+1
| | | | | | | | | | at it, use the ANSI C generic pointer type for the second argument, thus matching the documentation. Remove the now extraneous (and now conflicting) function declarations in various libc sources. Remove now unnecessary casts. Reviewed by: bde
* Some integrated Davicom cards in sparc64 boxes have an all zerosmux2004-01-081-0/+1
| | | | | | | | | | MAC address in the EEPROM, and we need to get it from OpenFirmware. This isn't very pretty but time is lacking to do this in a better way this near 5.2-RELEASE. This is a RELENG_5_2 candidate. Original version by: Marius Strobl <marius@alchemy.franken.de> Tested by: Pete Bentley <pete@sorted.org> Reviewed by: jake
* GC the unused <machine/kse.h> file.peter2003-12-241-38/+0
|
* - Modify alpha's sf_buf implementation to use the direct virtual-to-alc2003-11-161-0/+56
| | | | | | | | | physical mapping. - Move the sf_buf API to its own header file; make struct sf_buf's definition machine dependent. In this commit, we remove an unnecessary field from struct sf_buf on the alpha, amd64, and ia64. Ultimately, we may eliminate struct sf_buf on those architecures except as an opaque pointer that references a vm page.
* Fix a bug in the data access error recorvery. Before re-enabling the datajake2003-11-111-0/+9
| | | | | | | | | | | | cache after a data access error we must discard all cache lines. When disabled existing cache lines are not invalidated by stores to memory, so we risk reading stale data that was cached before the data access error if we don't flush them. This is especially fatal when the memory involved is the active part of the kernel or user stack. For good measure we also flush the instruction cache. This fixes random crashes when the X server probes the PCI bus through /dev/pci.
* Move pmap_resident_count() from the MD pmap.h to the MI pmap.h.bms2003-10-061-1/+0
| | | | | | | | Add a definition of pmap_wired_count(). Add a definition of vmspace_wired_count(). Reviewed by: truckman Discussed with: peter
* Make PAGE_SIZE and related quantities signed on sparc64. (They are signedalc2003-10-031-4/+4
| | | | | | quantities on every other architecture.) This change is required in order to move pmap_prefault() out of the pmap and into the machine-independent layer.
* Allow the compiler to micro-optimize byte swapping functions bymux2003-09-301-15/+24
| | | | | | | | evaluating them at compile time rather than at run time. As for x86 and amd64, this requires GCC and it's enabled only if __OPTIMIZE__ is defined (ie, if at least -O is used). Reviewed by: jake
* Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bitpeter2003-09-251-12/+0
| | | | | | | | | | | | | | | | | | | | | systems where the data/stack/etc limits are too big for a 32 bit process. Move the 5 or so identical instances of ELF_RTLD_ADDR() into imgact_elf.c. Supply an ia32_fixlimits function. Export the clip/default values to sysctl under the compat.ia32 heirarchy. Have mmap(0, ...) respect the current p->p_limits[RLIMIT_DATA].rlim_max value rather than the sysctl tweakable variable. This allows mmap to place mappings at sensible locations when limits have been reduced. Have the imgact_elf.c ld-elf.so.1 placement algorithm use the same method as mmap(0, ...) now does. Note that we cannot remove all references to the sysctl tweakable maxdsiz etc variables because /etc/login.conf specifies a datasize of 'unlimited'. And that causes exec etc to fail since it can no longer find space to mmap things.
* Implement the bus_space_map() function to allocate resources and initializenyan2003-09-231-0/+19
| | | | a bus_handle, but currently it does only initializing a bus_handle.
* Add function OF_decode_addr(). This function obtains the physicalmarcel2003-09-021-1/+2
| | | | | | | | | | | | | | | address of the device identified by its phandle_t by traversing OFW's device tree. The space and address returned by this function can subsequently be passed to sparc64_fake_bustag() to construct a valid tag and handle for use by the newbus I/O functions. Use of this function is expected to be limited to pre-newbus access to devices, such as consoles and keyboards. Partially obtained from: tmm Reviewed by: jake, jmg, tmm SBus testing made possible by: jake Tested with: LINT
* Standardize idempotentcy ifdefs. Consistently use _MACHINE_VARARGS_H_kan2003-09-011-3/+3
| | | | symbol.
* "md" files for syscons.jake2003-08-241-0/+76
|
* Further cleanup <machine/cpu.h> and <machine/md_var.h>: move the MImarcel2003-08-162-3/+3
| | | | | | | | | | | | | | | | | | | prototypes of cpu_halt(), cpu_reset() and swi_vm() from md_var.h to cpu.h. This affects db_command.c and kern_shutdown.c. ia64: move all MD prototypes from cpu.h to md_var.h. This affects madt.c, interrupt.c and mp_machdep.c. Remove is_physical_memory(). It's not used (vm_machdep.c). alpha: the MD prototypes have been left in cpu.h with a comment that they should be there. Moving them is left for later. It was expected that the impact would be significant enough to be done in a seperate commit. powerpc: MD prototypes left in cpu.h. Comment added. Suggested by: bde Tested with: make universe (pc98 incomplete)
* Expand inline the relevant parts of src/COPYRIGHT for Matt Dillon'simp2003-08-121-2/+24
| | | | | | copyrighted files. Approved by: Matt Dillon
* - Since td_critnest is now initialized in MI code, it doesn't have to bejhb2003-08-041-2/+0
| | | | | | set in cpu_critical_fork_exit() anymore. - As far as I can tell, cpu_thread_link() has never been used, not even when it was originally added, so remove it.
* Deal with 'options KSTACK_PAGES' being a global option.peter2003-07-311-0/+2
|
* - Introduce a new busdma flag BUS_DMA_ZERO to request for zero'edmux2003-07-271-0/+1
| | | | | | | memory in bus_dmamem_alloc(). This is possible now that contigmalloc() supports the M_ZERO flag. - Remove the locking of Giant around calls to contigmalloc() since contigmalloc() now grabs Giant itself.
* Avoid exposing declarations for kernel variables to userland.jake2003-07-171-0/+4
| | | | PR: 54528
* change CLASS depending upon __ELF_WORD_SIZE. This is necessary ifjmg2003-07-161-1/+5
| | | | someone wants to try to run 32bit binaries on sparc64.
* add support for interrupt counting on sparc64. This copies part of thejmg2003-07-162-0/+12
| | | | | | | | | code from i386. The code has a slight bogon that interrupts are counted twice. Once on the ithread dispatch and once on the dispatch for the vector vmstat -i and systat -vm now contains interrupt counts. Reviewed by: jake
* Lock down the IOMMU bus_dma implementation to make it safe to usetmm2003-07-103-35/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | without Giant held. A quick outline of the locking strategy: Since all IOMMUs are synchronized, there is a single lock, iommu_mtx, which protects the hardware registers (where needed) and the global and per-IOMMU software states. As soon as the IOMMUs are divorced, each struct iommu_state will have its own mutex (and the remaining global state will be moved into the struct). The dvma rman has its own internal mutex; the TSB slots may only be accessed by the owner of the corresponding resource, so neither needs extra protection. Since there is a second access path to maps via LRU queues, the consumer- provided locking is not sufficient; therefore, each map which is on a queue is additionally protected by iommu_mtx (in part, there is one member which only the map owner may access). Each map on a queue may be accessed and removed from or repositioned in a queue in any context as long as the lock is held; only the owner may insert a map. To reduce lock contention, some bus_dma functions remove the map from the queue temporarily (on behalf of the map owner) for some operations and reinsert it when they are done. Shorter operations and operations which are not done on behalf of the lock owner are completely covered by the lock. To facilitate the locking, reorganize the streaming buffer handling; while being there, fix an old oversight which would cause the streaming buffer to always be flushed, regardless of whether streaming was enabled in the TSB entry. The streaming buffer is still disabled for now, since there are a number of drivers which lack critical bus_dmamp_sync() calls. Additional testing by: jake
* Mega busdma API commit.scottl2003-07-011-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs
* Add the new sparc64 OFW PCI framework, conditional on options OFW_NEWPCItmm2003-07-011-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for now. It introduces a OFW PCI bus driver and a generic OFW PCI-PCI bridge driver. By utilizing these, the PCI handling is much more elegant now. The advantages of the new approach are: - Device enumeration should hopefully be more like on Solaris now, so unit numbers should match what's printed on the box more closely. - Real interrupt routing is implemented now, so cardbus bridges etc. have at least a chance to work. - The quirk tables are gone and have been replaced by (hopefully sufficient) heuristics. - Much cleaner code. There was also a report that previously bogus interrupt assignments are fixed now, which can be attributed to the new heuristics. A pitfall, and the reason why this is not the default yet, is that it changes device enumeration, as mentioned above, which can make it necessary to change the system configuration if more than one unit of a device type is present (on a system with two hme cars, for example, it is possible that hme0 becomes hme1 and vice versa after enabling the option). Systems with multiple disk controllers may need to be booted into single user (and require manual specification of the root file system on boot) to adjust the fstab. Nevertheless, I would like to encourage users to use this option, so that it can be made the default soon. In detail, the changes are: - Introduce an OFW PCI bus driver; it inherits most methods from the generic PCI bus driver, but uses the firmware for enumeration, performs additional initialization for devices and firmware-specific interrupt routing. It also implements an OFW-specific method to allow child devices to get their firmware nodes. - Introduce an OFW PCI-PCI bridge driver; again, it inherits most of the generic PCI-PCI bridge driver; it has it's own method for interrupt routing, as well as some sparc64-specific methods (one to get the node again, and one to adjust the bridge bus range, since we need to reenumerate all PCI buses). - Convert the apb driver to the new way of handling things. - Provide a common framework for OFW bridge drivers, used be the two drivers above. - Provide a small common framework for interrupt routing (for all bridge types). - Convert the psycho driver to the new framework; this gets rid of a bunch of old kludges in pci_read_config(), and the whole preinitialization (ofw_pci_init()). - Convert the ISA MD part and the EBus driver to the new way interrupts and nodes are handled. - Introduce types for firmware interrupt properties. - Rename the old sparcbus_if to ofw_pci_if by repo copy (it is only required for PCI), and move it to a more correct location (new support methodsx were also added, and an old one was deprecated). - Fix a bunch of minor bugs, perform some cleanups. In some cases, I introduced some minor code duplication to keep the new code clean, in hopes that the old code will be unifdef'ed soon. Reviewed in part by: imp Tested by: jake, Marius Strobl <marius@alchemy.franken.de>, Sergey Mokryshev <mokr@mokr.net>, Chris Jackman <cjackNOSPAM@klatsch.org> Info on u30 firmware provided by: kris
* add support for peeking at pci busses on UltraSparc systems. This preventsjmg2003-06-222-0/+36
| | | | | | | | | data access errors when trying to read/write to non-existant PCI devices. fix the psycho bridge to use peek for probing devices. This no longer fakes it if the OFW node doesn't exist (and the reg == 0). Reviewed by: jake, tmm
* Further cleanup of the sparc64 busdma implementation:tmm2003-06-183-172/+52
| | | | | | | | | | | | | | | | | | | | | | | | | - Move prototypes for sparc64-specific helper functions from bus.h to bus_private.h - Move the method pointers from struct bus_dma_tag into a separate structure; this saves some memory, and allows to use a single method table for each busdma backend, so that the bus drivers need no longer be changed if the methods tables need to be modified. - Remove the hierarchical tag method lookup. It was never really useful, since the layering is fixed, and the current implementations do not need to call into parent implementations anyway. Each tag inherits its method table pointer and cookie from the parent (or the root tag) now, and the method wrapper macros directly use the method table of the tag. - Add a method table to the non-IOMMU backend, remove unnecessary prototypes, remove the extra parent tag argument. - Rename sparc64_dmamem_alloc_map() and sparc64_dmamem_free_map() to sparc64_dma_alloc_map() and sparc64_dma_free_map(), move them to a better place and use them for all map allocations and deallocations. - Add a method table to the iommu backend, and staticize functions, remove the extra parent tag argument. - Change the psycho and sbus drivers to just set cookie and method table in the root tag. - Miscellaneous small fixes.
* Migrate the thread stack management functions from the machine-dependentalc2003-06-141-2/+1
| | | | | | | | | | | | | | | | to the machine-independent parts of the VM. At the same time, this introduces vm object locking for the non-i386 platforms. Two details: 1. KSTACK_GUARD has been removed in favor of KSTACK_GUARD_PAGES. The different machine-dependent implementations used various combinations of KSTACK_GUARD and KSTACK_GUARD_PAGES. To disable guard page, set KSTACK_GUARD_PAGES to 0. 2. Remove the (unnecessary) clearing of PG_ZERO in vm_thread_new. In 5.x, (but not 4.x,) PG_ZERO can only be set if VM_ALLOC_ZERO is passed to vm_page_alloc() or vm_page_grab().
* Remove the psycho and sbus iommu function stubs, and put the pointertmm2003-06-111-18/+13
| | | | | to the iommu_state structure directly into dt_cookie. The stubs have not been needed for a long time now.
* - Declare sparc64_memreg and sparc64_nmemreg in machine/ofw_mem.h.jake2003-06-071-0/+3
| | | | | - On startup print the total physical memory, instead of what we're told is free by the firmware, to avoid astonishing users.
* BKPT_INST is supposed to be a breakpoint, not 0.jake2003-06-071-1/+1
|
* Fix interrupt assignment for non-builtin PCI devices on e450s.tmm2003-05-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This machine uses a non-standard scheme to specify the interrupts to be assigned for devices in PCI slots; instead of giving the INO or full interrupt number (which is done for the other devices in this box), the firmware interrupt properties contain intpin numbers, which have to be swizzled as usual on PCI-PCI bridges; however, the PCI host bridge nodes have no interrupt map, so we need to guess the correct INO by slot number of the device or the closest PCI-PCI bridge leading to it, and the intpin. To do this, this fix makes the following changes: - Add a newbus method for sparc64 PCI host bridges to guess the INO, and glue code in ofw_pci_orb_callback() to invoke it based on a new quirk entry. The guessing is only done for interrupt numbers too low to contain any IGN found on e450s. - Create another new quirk entry was created to prevent mapping of EBus interrupts at PCI level; the e450 has full INOs in the interrupt properties of EBus devices, so trying to remap them could cause problems. - Set both quirk entries for e450s; remove the no-swizzle entry. - Determine the psycho half (bus A or B) a driver instance manages in psycho_attach() - Implement the new guessing method for psycho, using the slot number, psycho half and property value (intpin). Thanks go to the testers, especially Brian Denehy, who tested many kernels for me until I had found the right workaround. Tested by: Brian Denehy <B.Denehy@90east.com>, jake, fenner, Marius Strobl <marius@alchemy.franken.de>, Marian Dobre <mari@onix.ro> Approved by: re (scottl)
* Rename BUS_DMAMEM_NOSYNC to BUS_DMA_COHERENT.hmp2003-05-301-2/+1
| | | | | | | | | | | | | | | | | The current name is confusing, because it indicates to the client that a bus_dmamap_sync() operation is not necessary when the flag is specified, which is wrong. The main purpose of this flag is to hint the underlying architecture that DMA memory should be mapped in a coherent way, but the architecture can ignore it. But if the architecture does supports coherent mapping of memory, then it makes bus_dmamap_sync() calls cheap. This flag is the same as the one in NetBSD's Bus DMA. Reviewed by: gibbs, scottl, des (implicitly) Approved by: re@ (jhb)
* Bring back bus_dmasync_op_t. It is now a typedef to an int, though thescottl2003-05-271-2/+4
| | | | | | | | BUS_DMASYNC_ definitions remain as before. The does not change the ABI, and reverts the API to be a bit more compatible and flexible. This has survived a full 'make universe'. Approved by: re (bmah)
* De-orbit bus_dmamem_alloc_size(). It's a hack and was never used anyways.scottl2003-05-262-34/+0
| | | | | | No need for it to pollute the 5.x API any further. Approved by: re (bmah)
* sys/sys/limits.h:kan2003-05-192-3/+3
| | | | | | | | | | | | | | | - Fix visibilty test for LONG_BIT and WORD_BIT. `#if defined(__FOO_VISIBLE)' is alays wrong because __FOO_VISIBLE is always defined (to 0 for invisibility). sys/<arch>/include/limits.h sys/<arch>/include/_limits.h: - Style fixes. Submitted by: bde Reviewed by: bsdmike Approved by: re (scottl)
* Style fixes.kan2003-05-041-8/+11
| | | | | | | | | Remove DBL_DIG, DBL_MIN, DBL_MAX and their FLT_ counterparts, they were marked for deprecation ever since SUSv1 at least. Only define ULLONG_MIN/MAX and LLONG_MAX if long long type is supported. Restore a lost comment in MI _limits.h file and remove it from sys/limits.h where it does not belong.
* Slight reorg and added AMD64 support. A couple of the MODINFOMD_* valuespeter2003-05-011-6/+0
| | | | | | | | | that were added to sparc64 and later powerpc, really should have been in the MI area. But changing that now with insufficient preperation will just cause too much pain. Move MD_FETCH() to the MI sys/linker.h file to avoid another two copies of it.
* Allow fast instruction and data access mmu miss traps to be handled byjake2003-04-292-7/+9
| | | | user trap handlers.
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-291-64/+4
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* - Fix placement of cvs ids in previous commit to match .S files in libc.jake2003-04-291-11/+2
| | | | | - gcc uses 32 byte alignment for functions regardless of profiling, so follow suit.
* I was wrong, the ENTRY bits in asm.h did have a purpose -- for userland.obrien2003-04-262-40/+38
| | | | | | | Restore the bits and remove them from asmacros.h. *.S will now be asm.h consumers. Approved by: jake
* The ENTRY bits were in two places. Remove the one not used (asm.h), butobrien2003-04-262-24/+11
| | | | presurve the nice comment by adding it to asmacros.h.
* Two tokens that don't together form a vaid preprocssor token cannot beobrien2003-04-262-4/+4
| | | | | pasted together using ANSI-C token concatinatation. GCC's cpp, at least, produces the desired result w/o using "##".
* Add a new sys/limits.h file which in turn depends on machine/_limits.hkan2003-04-231-57/+39
| | | | | | | | | to get actual constant values. This is in preparation for machine/limits.h retirement. Discussed on: standards@ Submitted by: Craig Rodrigues <rodrigc@attbi.com> (*) Modified by: kan
* - Move the routine for flushing all user mappings from the tlb from pmap tojake2003-04-132-5/+8
| | | | | | | | | | | | the cpu dependent files. It will need to be done differently for USIII. - Simplify the logic for detecting context rollovers. Instead of dealing with it when the next context switch would cause the context numbers to rollover, deal with it when they actually do rollover. - Move some things around in cpu_switch so that we only do 1 membar #Sync when switching address space, instead of 2. - Detect kernel threads by comparing the new vm space to vmspace0, instead if checking if the tlb context is 0. - Removed some debug code.
* I deserve a big pointy hat for having missed all those referencesmux2003-04-101-1/+1
| | | | to bus_dmasync_op_t in my last commit.
* Change the operation parameter of bus_dmamap_sync() from anmux2003-04-101-9/+6
| | | | | | enum to an int and redefine the BUS_DMASYNC_* constants as flags. This allows us to specify several operations in one call to bus_dmamap_sync() as in NetBSD.
* Use vm_paddr_t for physical addresses.jake2003-04-089-31/+31
|
* Make the pmap stats writeable. It can be useful to clear them.jake2003-04-061-1/+1
|
OpenPOWER on IntegriCloud