summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
Commit message (Collapse)AuthorAgeFilesLines
* - Move the declaration of struct upa_ranges and the UPA_RANGE_* macrosmarius2005-12-035-54/+36
| | | | | | | | | | | | from sys/sparc64/include/ofw_upa.h to sys/sparc64/pci/ofw_pci.h and rename them to struct ofw_pci_ranges and OFW_PCI_RANGE_* respectively. This ranges struct only applies to host-PCI bridges but no to other bridges found on UPA. At the same time it applies to all host-PCI bridges regardless of whether the interconnection bus is Fireplane/ Safari, JBus or UPA. - While here rename the PCI_CS_* macros in sys/sparc64/pci/ofw_pci.h to OFW_PCI_CS_* in order to be consistent and change this header to use uintXX_t instead of u_intXX_t.
* - Adhere style(9) (don't use function calls in initializers).marius2005-12-031-3/+5
| | | | - Use FBSDID.
* Remove unused sc_node from softc.marius2005-12-031-2/+0
|
* - Adhere style(9) (don't use function calls in initializers, use uintXX_tmarius2005-12-035-29/+40
| | | | | instead of u_intXX_t). - Use FBSDID.
* - Register the PCI bus error interrupt handler according to which half ofmarius2005-12-031-26/+36
| | | | | | | | | | | | | | | | | | the bridge (PCI bus A or B) we are attaching to rather than registering both handlers at once when attaching to the first half we encounter. This is a bit cleaner as it corresponds to which PCI bus error interrupt actually is assigned to the respective half by the OFW and allows to collapse both PCI bus error interrupt handlers into one function easily. - Use the actual RID of the respective interrupt resource as index into sc_irq_res and also use it when allocating the resource. For now this is a bit cleaner and will be mandatory later on. - According to OpenSolaris the spare hardware interrupt is used as the over-temperature interrupt in systems with Psycho bridges. Unlike as with the SBus-based workstations I didn't manage to trigger it when covering the fan outlets of an U60 but better be safe than sorry and register a handler anyway. MFC after: 1 month
* - Improve the comment regarding the workaround for the E250 interrupt mapmarius2005-12-032-17/+31
| | | | | | | | | bug by explaining what the problem is and how the workaround works. - Fix some cosmetics nits, mainly properly terminate sentences in comments, which I missed when backporting the style changes to psycho(4) in psycho.c rev. 1.54 due to lack of corresponding code. - The "USIIe version of the Sabre bridge" actually is termed "Hummingbird"; name it as such in comments and messages.
* Remove superfluous bzero()'ing of the softc.marius2005-11-303-3/+0
|
* Remove superfluous inclusion of upa.h.marius2005-11-303-3/+0
|
* - Allow duplicate "machine" directives with the same arguments.ru2005-11-273-9/+1
| | | | - Move existing "machine" directives to DEFAULTS.
* - Add a workaround (change the interrupt map mask to compare the fullmarius2005-11-222-29/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INO) for incorrect interrupt map entries on E250 machines. These incorrect entries caused the INO of the on-board HME to be also assigned to the second on-board NS16550 and to the on-board printer port controller. Further down the road caused hme(4) to fail to attach to the on-board HME in FreeBSD 5 and 6 as INTR_FAST and non-INTR_FAST handlers can't share the same IRQ there (it's unknown what whould happen in -CURRENT now that INTR_FAST and non-INTR_FAST handlers can share an IRQ but I'd expect funny problems with uart(4)). - Make sure there are exactly 4 PCI ranges instead of just checking that the bridge has a 'ranges' property in the OFW device tree at all. Besides the fact that currently the 64bit memory range isn't used by this driver it we can't really work with less than 4 ranges and don't have memory for more than 4 bus handles for the ranges in the softc. - Remove sc_range and sc_nrange from softc; for the bridges supported by this driver we no longer need to know the ranges besides the bus handles obtained from them once this driver is attached. That way we also can free the memory allocated for sc_range during attach again. - Remove sc_dvmabase from the softc and pass it to psycho_iommu_init() via an additional argument as we no longer need to know the DVMA base in this driver once the IOMMU is initialized. - Remove sc_dmatag from the softc, there isn't much sense in keeping the nexus dma tag around locally. PR: 88279 [1] Info from: OpenSolaris [1] Tested by: kensmith [1] MFC after: 1 month
* Some clean-up, style changes and changes that will reduce differencesmarius2005-11-223-247/+244
| | | | | | | | | | | | | | | | | | | | | | | | | between this driver and other Host-PCI bridge drivers based on this one: - Make the code fit into 80 columns. - Make the code adhere style(9) (don't use function calls in initializers, use uintXX_t instead of u_intXX_t, add missing prototypes, ...). - Remove unused and superfluous struct declaration, softc member, casts, includes, etc. - Use FBSDID. - Sprinkle const. - Try to make comments and messages consistent in style throughout the driver. - Use convenience macros for the number of interrupts and ranges of the bridge. - Use __func__ instead of hardcoded function names in panic strings and error messages. Some of the hardcoded function names actually were outdated through moving code around. [1] - Rename softc members related to the PCI side of the bridge to sc_pci_* in order to make it clear which side of the bridge they refer to (so stuff like sc_bushandle vs. sc_bh is less confusing while reading the code). PR: 76052 [1]
* - Convert these bus drivers to make use of the newly introduced set ofmarius2005-11-229-611/+334
| | | | | | | | | | | | | ofw_bus_gen_get_*() for providing the ofw_bus KOBJ interface in order to reduce code duplication. - While here sync the various sparc64 bus drivers a bit (handle failure to attach a child gracefully instead of panicing, move the printing of child resources common to bus_print_child() and bus_probe_nomatch() implementations of a bus into a <bus>_print_res() function, ...) and fix some minor bugs and nits (plug memory leaks present when attaching a bus or child device fails, remove unused struct members, ...). Additional testing by: kris (central(4) and fhc(4))
* Turn PUC_FASTINTR back off on by default on sparc64 since it breaks withjhb2005-11-211-2/+0
| | | | | | the built-in serial ports on the ultra60 and e4500. In collusion with: kris
* Don't enable PUC_FASTINTR by default in the source. Instead, enable itjhb2005-11-211-0/+2
| | | | | | | | | | | via the DEFAULTS kernel configs. This allows folks to turn it that option off in the kernel configs if desired without having to hack the source. This is especially useful since PUC_FASTINTR hangs the kernel boot on my ultra60 which has two uart(4) devices hung off of a puc(4) device. I did not enable PUC_FASTINTR by default on powerpc since powerpc does not currently allow sharing of INTR_FAST with non-INTR_FAST like the other archs.
* Create DEFAULTS files for alpha, ia64, powerpc, and sparc64 and movejhb2005-11-212-1/+10
| | | | | | 'device mem' over from GENERIC to DEFAULTS to be consistent with i386 and amd64. Additionally, on ia64 enable ACPI by default since ia64 requires acpi.
* Eliminate pmap_init2(). It's no longer used.alc2005-11-201-10/+0
|
* Uncomment em(4) as it's now working.yongari2005-11-091-1/+1
|
* Reimplement the reclamation of PV entries. Specifically, performalc2005-11-091-2/+0
| | | | | | | | | | | | | | | | | | reclamation synchronously from get_pv_entry() instead of asynchronously as part of the page daemon. Additionally, limit the reclamation to inactive pages unless allocation from the PV entry zone or reclamation from the inactive queue fails. Previously, reclamation destroyed mappings to both inactive and active pages. get_pv_entry() still, however, wakes up the page daemon when reclamation occurs. The reason being that the page daemon may move some pages from the active queue to the inactive queue, making some new pages available to future reclamations. Print the "reclaiming PV entries" message at most once per minute, but don't stop printing it after the fifth time. This way, we do not give the impression that the problem has gone away. Reviewed by: tegge
* Add stoppcbs[] arrays on Alpha and sparc64 and have each CPU save itsjhb2005-11-032-0/+5
| | | | | | | | current context in the IPI_STOP handler so that we can get accurate stack traces of threads on other CPUs on these two archs like we do now on i386 and amd64. Tested on: alpha, sparc64
* Reorganize the interrupt handling code a bit to make a few things cleanerjhb2005-10-252-37/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and increase flexibility to allow various different approaches to be tried in the future. - Split struct ithd up into two pieces. struct intr_event holds the list of interrupt handlers associated with interrupt sources. struct intr_thread contains the data relative to an interrupt thread. Currently we still provide a 1:1 relationship of events to threads with the exception that events only have an associated thread if there is at least one threaded interrupt handler attached to the event. This means that on x86 we no longer have 4 bazillion interrupt threads with no handlers. It also means that interrupt events with only INTR_FAST handlers no longer have an associated thread either. - Renamed struct intrhand to struct intr_handler to follow the struct intr_foo naming convention. This did require renaming the powerpc MD struct intr_handler to struct ppc_intr_handler. - INTR_FAST no longer implies INTR_EXCL on all architectures except for powerpc. This means that multiple INTR_FAST handlers can attach to the same interrupt and that INTR_FAST and non-INTR_FAST handlers can attach to the same interrupt. Sharing INTR_FAST handlers may not always be desirable, but having sio(4) and uhci(4) fight over an IRQ isn't fun either. Drivers can always still use INTR_EXCL to ask for an interrupt exclusively. The way this sharing works is that when an interrupt comes in, all the INTR_FAST handlers are executed first, and if any threaded handlers exist, the interrupt thread is scheduled afterwards. This type of layout also makes it possible to investigate using interrupt filters ala OS X where the filter determines whether or not its companion threaded handler should run. - Aside from the INTR_FAST changes above, the impact on MD interrupt code is mostly just 's/ithread/intr_event/'. - A new MI ddb command 'show intrs' walks the list of interrupt events dumping their state. It also has a '/v' verbose switch which dumps info about all of the handlers attached to each event. - We currently don't destroy an interrupt thread when the last threaded handler is removed because it would suck for things like ppbus(8)'s braindead behavior. The code is present, though, it is just under #if 0 for now. - Move the code to actually execute the threaded handlers for an interrrupt event into a separate function so that ithread_loop() becomes more readable. Previously this code was all in the middle of ithread_loop() and indented halfway across the screen. - Made struct intr_thread private to kern_intr.c and replaced td_ithd with a thread private flag TDP_ITHREAD. - In statclock, check curthread against idlethread directly rather than curthread's proc against idlethread's proc. (Not really related to intr changes) Tested on: alpha, amd64, i386, sparc64 Tested on: arm, ia64 (older version of patch by cognet and marcel)
* Remove "nodevice snd_es137x" as it is supported now.yongari2005-10-251-1/+0
|
* Fix compiling.davidxu2005-10-151-1/+1
|
* Add a default value for VM_BCACHE_SIZE_MAX of 400MB. This is copied fromkris2005-10-141-0/+8
| | | | | | | | amd64, and is a factor of 3 less than the value previously auto-sized on a 12GB machine, which would cause an overflow in calculations involving the maxbcache int, causing bufinit() to loop forever at boot. Reviewed by: mlaier, peter
* 1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, mostdavidxu2005-10-142-24/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changes in MD code are trivial, before this change, trapsignal and sendsig use discrete parameters, now they uses member fields of ksiginfo_t structure. For sendsig, this change allows us to pass POSIX realtime signal value to user code. 2. Remove cpu_thread_siginfo, it is no longer needed because we now always generate ksiginfo_t data and feed it to libpthread. 3. Add p_sigqueue to proc structure to hold shared signals which were blocked by all threads in the proc. 4. Add td_sigqueue to thread structure to hold all signals delivered to thread. 5. i386 and amd64 now return POSIX standard si_code, other arches will be fixed. 6. In this sigqueue implementation, pending signal set is kept as before, an extra siginfo list holds additional siginfo_t data for signals. kernel code uses psignal() still behavior as before, it won't be failed even under memory pressure, only exception is when deleting a signal, we should call sigqueue_delete to remove signal from sigqueue but not SIGDELSET. Current there is no kernel code will deliver a signal with additional data, so kernel should be as stable as before, a ksiginfo can carry more information, for example, allow signal to be delivered but throw away siginfo data if memory is not enough. SIGKILL and SIGSTOP have fast path in sigqueue_add, because they can not be caught or masked. The sigqueue() syscall allows user code to queue a signal to target process, if resource is unavailable, EAGAIN will be returned as specification said. Just before thread exits, signal queue memory will be freed by sigqueue_flush. Current, all signals are allowed to be queued, not only realtime signals. Earlier patch reviewed by: jhb, deischen Tested on: i386, amd64
* Add a new atomic_fetchadd() primitive that atomically adds a value to ajhb2005-09-271-0/+3
| | | | | | | | | variable and returns the previous value of the variable. Tested on: i386, alpha, sparc64, arm (cognet) Reviewed by: arch@ Submitted by: cognet (arm) MFC after: 1 week
* Introduce a kernel config for the Mandatory Access Control framework.csjp2005-09-181-0/+28
| | | | | | | | This kernel config briefly describes some of the major MAC policies available on FreeBSD. The hope is that this will raise the awareness about MAC and get more people interested. Discussed with: scottl
* Move the prototypes of db_md_set_watchpoint(), db_md_clr_watchpoint()marcel2005-09-101-4/+0
| | | | and db_md_list_watchpoints() to ddb/ddb.h.
* Pass a value of type vm_prot_t to pmap_enter_quick() so that it determinealc2005-09-031-2/+3
| | | | whether the mapping should permit execute access.
* Move MINSIGSTKSZ from <machine/signal.h> to <machine/_limits.h> and renamestefanf2005-08-202-4/+3
| | | | | | | | | | it to __MINSIGSTKSZ. Define MINSIGSTKSZ in <sys/signal.h>. This is done in order to use MINSIGSTKSZ for the macro PTHREAD_STACK_MIN in <pthread.h> (soon <limits.h>) without having to include the whole <sys/signal.h> header. Discussed with: bde
* Remove a stale occurrence of 'alpha' in a comment.stefanf2005-08-201-1/+1
|
* Now that at least some screen savers work on sparc64 sync with othermarius2005-08-151-1/+1
| | | | | | | | archs and enable splash(4) by default (the non-working screen savers either don't compile or just have no effect when loaded, i.e. don't cause harm). MFC after: 1 week
* The system tick _compare_ register of USIII CPUs and up is ASR25, notmarius2005-08-071-1/+1
| | | | ASR24 (which is the system tick register).
* - Add support for saving stack traces and displaying them via printf(9)jeff2005-08-031-0/+21
| | | | | | | and KTR. Contributed by: Antoine Brodin <antoine.brodin@laposte.net> Concept code from: Neal Fachan <neal@isilon.com>
* Add extra constraints to tell the compiler that the memory be modifiedjhb2005-07-271-4/+6
| | | | | | | | | | | | in the arm __swp() and sparc64 casa() and casax() functions is actually being used as an input and output and not just the value of the register that points to the memory location. This was the underlying source of the mbuf refcount problems on sparc64 a while back. For arm this should be a nop because __swp() has a constraint to clobber all memory which can probably be removed now. Reviewed by: alc, cognet MFC after: 1 week
* Convert the atomic_ptr() operations over to operating on uintptr_tjhb2005-07-151-1/+1
| | | | | | | | | | variables rather than void * variables. This makes it easier and simpler to get asm constraints and volatile keywords correct. MFC after: 3 days Tested on: i386, alpha, sparc64 Compiled on: ia64, powerpc, amd64 Kernel toolchain busted on: arm
* Add recently invented COMPAT_FREEBSD5 option.kensmith2005-07-141-0/+1
| | | | MFC after: 3 days
* Validate if the value written into {FS,GS}.base is a canonicaldavidxu2005-07-101-1/+2
| | | | | | | | | address, writting non-canonical address can cause kernel a panic, by restricting base values to 0..VM_MAXUSER_ADDRESS, ensuring only canonical values get written to the registers. Reviewed by: peter, Josepha Koshy < joseph.koshy at gmail dot com > Approved by: re (scottl)
* - Declare lookup tables etc. const.marius2005-07-102-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | - Let creator_bitblt() return ENODEV as it's not implemented (missed in sys/dev/fb/creator.c rev. 1.6). - As a speed optimization inline the creator_ras_wait() etc. helper functions and also cache setting the font increment, font width and plane mask. [1] - I got the meaning of V_DISPLAY_BLANK wrong, it's blank like turn off and not blank like turn on and clear the screen. So move clearing the screen to creator_clear() were it hopefully belongs. - Properly implement V_DISPLAY_BLANK, V_DISPLAY_STAND_BY and V_DISPLAY_SUSPEND. This makes blank_saver.ko and green_saver.ko work. [1] - Change the order of operations in creator_fill_rect(), i.e. write y before x and cy before cx. This fixes drawing the top part of the border with Elite3D cards when switching from Xorg to a VTY. - Move setting the chip configuration we use and invalidating the cache variables to creator_set_mode() and set the V_ADP_MODECHANGE flag. This causes creator_set_mode() to be called when the X server shuts down which fixes the screen corruption caused most of the time by Xorg not restoring the original configuration present at startup. Inspired by/based on: Xorg [1] Approved by: re (scottl)
* Add .cvsignore files just like in sys/<arch>/compiled, this keeps CVS fromobrien2005-06-201-0/+1
| | | | | | questing kernel config files not in CVS. Approved by: re(kensmith)
* Turn on atkbdc(4), atkbd(4), creator(4), machfb(4), syscons(4), ohci(4),marius2005-06-101-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | psm(4), ukbd(4), ums(4) and usb(4) on by default. Modulo some nits with the most annoying one probably being USB keyboards no longer working at the OFW boot prompt after halting FreeBSD these drivers work fine on sparc64 including X and there's nothing left that I'd consider a show- stopper. I.e. graphical consoles on sun4u machines should either work out of the box or by plugging in a card that is supported by either creator(4) or machfb(4). The exception obviously are SBus-only machines without UPA slots like some Ultra 1 (but which also still lack support in other areas) and certain Exx0 (but which probably are mainly used with serial consoles anyway). I'll try to add a cgsix(4) for these later as Sun CG6 cards are probably the most common SBus framebuffer cards in sun4u machines. I however don't see much sense in adding drivers for the dozen of SBus framebuffers that were destined for sparc v8 machines. The rest of the USB drivers aren't enabled as I'm only aware of ukbd(4) and ums(4) as well as ohci(4) working with the on-board ALI M5237 and Sun PCIO-2 controllers. Aue(4) definitely doesn't work on sparc64, yet. Thanks to: - Jake for the initial work on syscons(4) on sparc64 and creator(4). - Marcel for uart(4) and especially for its support for the SCCs which are only used on sparc64 so far. In various regards it wouldn't have been possible to enable syscons(4) by default on sparc64, yet, without uart(4). - All that tested patches. Ok'ed by: scottl (RE hat), tmm
* - Hook up atkbdc(4), atkbd(4) and psm(4) to the sparc64 build, notmarius2005-06-102-4/+4
| | | | | | enabled in GENERIC by default, yet. - While here remove the exclusion of ukbd(4) from the sparc64 NOTES as ukbd(4) compiles and works on sparc64.
* Introduce a procedure, pmap_page_init(), that initializes thealc2005-06-101-10/+13
| | | | | | | | | | | | | | | | | | | vm_page's machine-dependent fields. Use this function in vm_pageq_add_new_page() so that the vm_page's machine-dependent and machine-independent fields are initialized at the same time. Remove code from pmap_init() for initializing the vm_page's machine-dependent fields. Remove stale comments from pmap_init(). Eliminate the Boolean variable pmap_initialized from the alpha, amd64, i386, and ia64 pmap implementations. Its use is no longer required because of the above changes and earlier changes that result in physical memory that is being mapped at initialization time being mapped without pv entries. Tested by: cognet, kensmith, marcel
* MFP4:jkoshy2005-06-091-0/+14
| | | | | | | | | | | | | | | | - Implement sampling modes and logging support in hwpmc(4). - Separate MI and MD parts of hwpmc(4) and allow sharing of PMC implementations across different architectures. Add support for P4 (EMT64) style PMCs to the amd64 code. - New pmcstat(8) options: -E (exit time counts) -W (counts every context switch), -R (print log file). - pmc(3) API changes, improve our ability to keep ABI compatibility in the future. Add more 'alias' names for commonly used events. - bug fixes & documentation.
* Remove superfluous breaks.marius2005-06-051-3/+0
|
* After some input from bde@ and rereading the datasheet use a MTX_SPINmarius2005-06-041-1/+1
| | | | | | | | mutex instead of a MTX_DEF one in order to defer preemption while reading the date and time registers. If we don't manage to read them within the time slot where we are guaranteed that no updates occur we might actually read them during an update in which case the output is undefined.
* - In creator_configure() when probed for the high-level console returnmarius2005-06-042-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | the number of registered adapters instead of determining again whether stdout is a supported card (and which might have failed to attach and register). - Drop creator_set_mode() and move the relevant parts to creator_fill_rect() and creator_putc() respectively. This is a bit cleaner than having to make sure that creator_set_mode() was called before creator_fill_rect() or creator_putc() are used and matches better what Xorg does. - Fix a bug in the handling of the FBIOSCURSOR IOCTL; the code was meant to return ENODEV for all invocations expect when used to disable the cursor and not just when used for enabling the cursor. - In case the adapter is the OFW stdout move its OFW cursor to the start of the last line on halt so OFW output doesn't get intermixed with what FreeBSD left on the screen. With hindsight this is what the faking of a hardware cursor which was removed in the last revision really was about, i.e. to keep the OFW updated about the current cursor position. The new approach however is simpler while producing the same result and doesn't cause the first letter of the OFW output to be turned into a blank and a newline. - Add variable names to the prototypes of creator_cursor_*() which were added in the last revision and list them alphabetically in order to match the style of this file.
* Now that all affected drivers have been changed remove the helpersmarius2005-06-041-34/+3
| | | | | | | | | for the SYS_RES_IOPORT -> SYS_RES_MEMORY transition again. While it was helpful to not need to change all of the affected drivers in a single pass together with ebus(4) we probably shouldn't start into 6.0 with such a hack. This requires some of the modules of affected drivers to be rebuilt, namely: auxio(4), snd_audiocs(4) and puc(4).
* Create nexus in configure_first() instead of in configure(). Thismarcel2005-05-291-1/+2
| | | | | makes sure that sysinit tasks that run after configure_first(), but before configure() have a nexus to hang devices off.
* Call cninit_finish() from configure_final().marcel2005-05-291-0/+1
|
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-292-66/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
OpenPOWER on IntegriCloud