aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64
Commit message (Collapse)AuthorAgeFilesLines
* Resort the if_ti driver to match the PCI Network cards instead of placingRemko Lodder2008-05-171-1/+1
| | | | | | | | | | | | it under the mii devices list. PR: kern/123147 Submitted by: gavin Approved by: imp (mentor, implicit) MFC after: 3 days Notes: svn path=/head/; revision=179078
* Add a stub for pmap_align_superpage() on machines that don't (yet)Alan Cox2008-05-091-0/+10
| | | | | | | implement pmap-level support for superpages. Notes: svn path=/head/; revision=178893
* - Remove the BUS_HANDLE_MIN checking in the __BUS_DEBUG_ACCESS macro;Marius Strobl2008-05-081-81/+109
| | | | | | | | | | for UPA it should have fulfilled its purpose by now and Fireplane- and JBus-based machines are way to messy in organization to implement something equivalent. - Fix a bunch of style(9) bugs. Notes: svn path=/head/; revision=178860
* Remove #if 0'ed code referencing no longer existent ecache_flush().Marius Strobl2008-05-081-7/+0
| | | | Notes: svn path=/head/; revision=178859
* Use <machine/intr_machdep.h> directly instead of depending on headerMarius Strobl2008-05-081-1/+1
| | | | | | | pollution in the otherwise unused <sys/pcpu.h>. Notes: svn path=/head/; revision=178858
* - Use the name returned by device_get_nameunit(9) for the name of theMarius Strobl2008-05-076-58/+49
| | | | | | | | | | | | | | | counter-timer timecounter so the associated SYSCTL nodes don't clash on machines having multiple U2P and U2S bridges as well as establishing a clear mapping between these bridges and their timecounter device. - Don't bother setting up a "nice" name for the IOMMU, just use the name returned by device_get_nameunit(9), too. - Fix some minor style(9) bugs. - Use __FBSDID in counter.c MFC after: 1 week Notes: svn path=/head/; revision=178840
* enable IEEE80211_DEBUG and IEEE80211_AMPDU_AGE by defaultSam Leffler2008-05-031-0/+2
| | | | Notes: svn path=/head/; revision=178742
* Remove an header which is unused for sun4v.Marius Strobl2008-05-021-1/+3
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=178728
* Remove the MD isa_irq_pending() and the underlying PCI-specificMarius Strobl2008-04-264-104/+0
| | | | | | | | | | | | infrastructure. Its only consumer ever was sio(4) and thus was unused on sparc64 since removing the last traces of sio(4) in sparc64 configuration files in favor for uart(4) over three years ago. If similar functionality is required again it should be brought back as an MD intr_pending() which works for all busses by using for example interrupt controller hooks. Notes: svn path=/head/; revision=178579
* - Add an integer argument to idle to indicate how likely we are to wakeJeff Roberson2008-04-251-1/+8
| | | | | | | | | | | | | | | | | | from idle over the next tick. - Add a new MD routine, cpu_wake_idle() to wakeup idle threads who are suspended in cpu specific states. This function can fail and cause the scheduler to fall back to another mechanism (ipi). - Implement support for mwait in cpu_idle() on i386/amd64 machines that support it. mwait is a higher performance way to synchronize cpus as compared to hlt & ipis. - Allow selecting the idle routine by name via sysctl machdep.idle. This replaces machdep.cpu_idle_hlt. Only idle routines supported by the current machine are permitted. Sponsored by: Nokia Notes: svn path=/head/; revision=178471
* - Include <machine/utrap.h> so this header doesn't have an MDMarius Strobl2008-04-231-5/+7
| | | | | | | | | | dependency. - Make prototypes style(9) compliant. MFC after: 1 week Notes: svn path=/head/; revision=178445
* o Rename ic_eoi to ic_clear to emphasize the functions it pointsMarius Strobl2008-04-239-65/+261
| | | | | | | | | | | | | | | | | | | | | | don't send and EOI which works like on amd64/i386 and blocks all interrupts on the relevant interrupt controller. o Replace the post_filter and post_inthread hooks registered when creating the interrupt events with just ic_clear as on sparc64 we don't need to do any disable->EOI->enable dance to unblock all but the relevant interrupt while running the filter or handler; just not clearing the interrupt already has the same effect. o Merge from amd64/i386: - Split the intr_table_lock into an sx lock used for most things, and a spin lock to protect intrcnt_index. - Add support for binding interrupts to CPUs, including for the bus_bind_intr(9) interface, a assign_cpu hook and initially shuffling interrupts arround in a round-robin fashion. Reviewed by: jhb MFC after: 1 month Notes: svn path=/head/; revision=178443
* Make genclock standard on all platforms.Poul-Henning Kamp2008-04-212-2/+0
| | | | | | | Thanks to: grehan & marcel for platform support on ia64 and ppc. Notes: svn path=/head/; revision=178372
* Multi-bss (aka vap) support for 802.11 devices.Sam Leffler2008-04-201-2/+0
| | | | | | | | | | | | | | Note this includes changes to all drivers and moves some device firmware loading to use firmware(9) and a separate module (e.g. ral). Also there no longer are separate wlan_scan* modules; this functionality is now bundled into the wlan module. Supported by: Hobnob and Marvell Reviewed by: many Obtained from: Atheros (some bits) Notes: svn path=/head/; revision=178354
* On sparc64 machines with multiple host-PCI-bridges these bridgesMarius Strobl2008-04-178-149/+21
| | | | | | | | | | | | | | | | | | | | have separate configuration spaces so by definition they implement different PCI domains. Thus change psycho(4) to use PCI domains instead of reenumerating all PCI busses so they have globally unique bus numbers and drop support for reenumerating busses in the OFW PCI code. According to CVS history reenumeration was also required in order to get some E450 to boot but given that no other open source kernel changes the PCI bus numbers assigned by the firmware I believe the real problem was that the old code used the bus number as the device number for the PCI busses and unlike most of the other machines the firmwares of the problematic ones don't use disjoint PCI bus numbers across the host-PCI-bridges. MFC after: 1 month Notes: svn path=/head/; revision=178279
* - Add the interrupt vector number to intr_event_create so MI code canJeff Roberson2008-04-111-1/+1
| | | | | | | | | | | | | | | lookup hard interrupt events by number. Ignore the irq# for soft intrs. - Add support to cpuset for binding hardware interrupts. This has the side effect of binding any ithread associated with the hard interrupt. As per restrictions imposed by MD code we can only bind interrupts to a single cpu presently. Interrupts can be 'unbound' by binding them to all cpus. Reviewed by: jhb Sponsored by: Nokia Notes: svn path=/head/; revision=178092
* - Add support for IPI_PREEMPT. [1]Marius Strobl2008-04-094-2/+15
| | | | | | | | | | - Add my copyright to mp_machdep.c for having implemented support for USIII and up and some fixes. Obtained from: sun4v (modulo style(9) bugs) [1] Notes: svn path=/head/; revision=178048
* Add a MI intr_event_handle() routine for the non-INTR_FILTER case. ThisJohn Baldwin2008-04-051-51/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | allows all the INTR_FILTER #ifdef's to be removed from the MD interrupt code. - Rename the intr_event 'eoi', 'disable', and 'enable' hooks to 'post_filter', 'pre_ithread', and 'post_ithread' to be less x86-centric. Also, add a comment describe what the MI code expects them to do. - On amd64, i386, and powerpc this is effectively a NOP. - On arm, don't bother masking the interrupt unless the ithread is scheduled in the non-INTR_FILTER case to match what INTR_FILTER did. Also, don't bother unmasking the interrupt in the post_filter case if we never masked it. The INTR_FILTER case had been doing this by having arm_unmask_irq for the post_filter (formerly 'eoi') hook. - On ia64, stray interrupts are now masked for the non-INTR_FILTER case. They were already masked in the INTR_FILTER case. - On sparc64, use the a NULL pre_ithread hook and use intr_enable_eoi() for both the 'post_filter' and 'post_ithread' hooks to match what the non-INTR_FILTER code did. - On sun4v, retire the ithread wrapper hack by using an appropriate 'post_ithread' hook instead (it's what 'post_ithread'/'enable' was designed to do even in 5.x). Glanced at by: piso Reviewed by: marius Requested by: marius [1], [5] Tested on: amd64, i386, arm, sparc64 Notes: svn path=/head/; revision=177940
* Add kernel module support for nfslockd and krpc. Use the module systemDoug Rabson2008-03-271-0/+1
| | | | | | | | | | to detect (or load) kernel NLM support in rpc.lockd. Remove the '-k' option to rpc.lockd and make kernel NLM the default. A user can still force the use of the old user NLM by building a kernel without NFSLOCKD and/or removing the nfslockd.ko module. Notes: svn path=/head/; revision=177662
* When building a kernel module, define MAXCPU the same as SMP soJohn Birrell2008-03-271-2/+2
| | | | | | | that modules work with and without SMP. Notes: svn path=/head/; revision=177661
* The "free-lance" timer in the i8254 is only used for the speakerPoul-Henning Kamp2008-03-262-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | these days, so de-generalize the acquire_timer/release_timer api to just deal with speakers. The new (optional) MD functions are: timer_spkr_acquire() timer_spkr_release() and timer_spkr_setfreq() the last of which configures the timer to generate a tone of a given frequency, in Hz instead of 1/1193182th of seconds. Drop entirely timer2 on pc98, it is not used anywhere at all. Move sysbeep() to kern/tty_cons.c and use the timer_spkr*() if they exist, and do nothing otherwise. Remove prototypes and empty acquire-/release-timer() and sysbeep() functions from the non-beeping archs. This eliminate the need for the speaker driver to know about i8254frequency at all. In theory this makes the speaker driver MI, contingent on the timer_spkr_*() functions existing but the driver does not know this yet and still attaches to the ISA bus. Syscons is more tricky, in one function, sc_tone(), it knows the hz and things are just fine. In the other function, sc_bell() it seems to get the period from the KDMKTONE ioctl in terms if 1/1193182th second, so we hardcode the 1193182 and leave it at that. It's probably not important. Change a few other sysbeep() uses which obviously knew that the argument was in terms of i8254 frequency, and leave alone those that look like people thought sysbeep() took frequency in hertz. This eliminates the knowledge of i8254_freq from all but the actual clock.c code and the prof_machdep.c on amd64 and i386, where I think it would be smart to ask for help from the timecounters anyway [TBD]. Notes: svn path=/head/; revision=177642
* - Const'ify the bus_stream_asi and bus_type_asi arrays.Marius Strobl2008-03-242-14/+13
| | | | | | | | | | | - Replace hard-coded functions names missed in bus_machdep.c rev. 1.44 with __func__. - Break some long lines. MFC after: 1 month Notes: svn path=/head/; revision=177565
* Oops. Use atomic_add_long() for atomic_fetchadd_long() (not atomic_add_int())Pawel Jakub Dawidek2008-03-191-2/+1
| | | | | | | | | for sparc64 and sun4v. Noticed by: marius Notes: svn path=/head/; revision=177373
* Simplify the interrupt code a bit:John Baldwin2008-03-171-6/+2
| | | | | | | | | | | | | | | - Always include the ie_disable and ie_eoi methods in 'struct intr_event' and collapse down to one intr_event_create() routine. The disable and eoi hooks simply aren't used currently in the !INTR_FILTER case. - Expand 'disab' to 'disable' in a few places. - Use function casts for arm and i386:intr_eoi_src() instead of wrapper routines since to trim one extra indirection. Compiled on: {arm,amd64,i386,ia64,ppc,sparc64} x {FILTER, !FILTER} Tested on: {amd64,i386} x {FILTER, !FILTER} Notes: svn path=/head/; revision=177325
* Implement atomic_fetchadd_long() for all architectures and document it.Pawel Jakub Dawidek2008-03-161-0/+2
| | | | | | | Reviewed by: attilio, jhb, jeff, kris (as a part of the uidinfo_waitfree.patch) Notes: svn path=/head/; revision=177276
* In keeping with style(9)'s recommendations on macros, use a ';'Robert Watson2008-03-161-1/+1
| | | | | | | | | | | | after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr. MFC after: 1 month Discussed with: imp, rink Notes: svn path=/head/; revision=177253
* Add preliminary support for binding interrupts to CPUs:John Baldwin2008-03-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a new intr_event method ie_assign_cpu() that is invoked when the MI code wishes to bind an interrupt source to an individual CPU. The MD code may reject the binding with an error. If an assign_cpu function is not provided, then the kernel assumes the platform does not support binding interrupts to CPUs and fails all requests to do so. - Bind ithreads to CPUs on their next execution loop once an interrupt event is bound to a CPU. Only shared ithreads are bound. We currently leave private ithreads for drivers using filters + ithreads in the INTR_FILTER case unbound. - A new intr_event_bind() routine is used to bind an interrupt event to a CPU. - Implement binding on amd64 and i386 by way of the existing pic_assign_cpu PIC method. - For x86, provide a 'intr_bind(IRQ, cpu)' wrapper routine that looks up an interrupt source and binds its interrupt event to the specified CPU. MI code can currently (ab)use this by doing: intr_bind(rman_get_start(irq_res), cpu); however, I plan to add a truly MI interface (probably a bus_bind_intr(9)) where the implementation in the x86 nexus(4) driver would end up calling intr_bind() internally. Requested by: kmacy, gallatin, jeff Tested on: {amd64, i386} x {regular, INTR_FILTER} Notes: svn path=/head/; revision=177181
* Remove kernel support for M:N threading.Jeff Roberson2008-03-122-7/+0
| | | | | | | | | | | While the KSE project was quite successful in bringing threading to FreeBSD, the M:N approach taken by the kse library was never developed to its full potential. Backwards compatibility will be provided via libmap.conf for dynamically linked binaries and static binaries will be broken. Notes: svn path=/head/; revision=177091
* Uncomment vr(4), vr(4) should work on all architectures.Pyun YongHyeon2008-03-111-1/+1
| | | | Notes: svn path=/head/; revision=177052
* - Fix some style bugs.Marius Strobl2008-03-091-48/+54
| | | | | | | | | - Replace hard-coded functions names missed in rev. 1.44 with __func__. MFC after: 1 week Notes: svn path=/head/; revision=176995
* - Do as the comment in pmap_bootstrap() suggests and flush all non-lockedMarius Strobl2008-03-097-19/+85
| | | | | | | | | | | TLB entries possibly left over by the firmware and also do so while bootstrapping APs. - Use __FBSDID. MFC after: 1 month Notes: svn path=/head/; revision=176994
* - Remove the old smp cpu topology specification with a new, more flexibleJeff Roberson2008-03-021-0/+7
| | | | | | | | | | | | | | | | | | | | tree structure that encodes the level of cache sharing and other properties. - Provide several convenience functions for creating one and two level cpu trees as well as a default flat topology. The system now always has some topology. - On i386 and amd64 create a seperate level in the hierarchy for HTT and multi-core cpus. This will allow the scheduler to intelligently load balance non-uniform cores. Presently we don't detect what level of the cache hierarchy is shared at each level in the topology. - Add a mechanism for testing common topologies that have more information than the MD code is able to provide via the kern.smp.topology tunable. This should be considered a debugging tool only and not a stable api. Sponsored by: Nokia Notes: svn path=/head/; revision=176734
* The Sun disk label only uses 16-bit fields for cylinders, heads andMarius Strobl2008-02-112-0/+65
| | | | | | | | | | | | | | | | | sectors so the geometry of large IDE disks has to be adjusted. This corresponds to what the OpenSolaris dad(7D) driver does except that the latter only tweaks sectors and effectively limits the mediasize to 128GB so the cylinders and heads fields won't ever overflow. Not limiting the mediasize is a compromise between allowing to use Sun disk label as far as possible and being able to use the entire disk with another disk label. This allows to use the full capacity of large IDE disks if they were not labeled under (Open)Solaris (in both ways of the meaning). MFC after: 2 weeks Notes: svn path=/head/; revision=176197
* Add a wrapper function that bound checks writes to the dump device.Ruslan Ermilov2008-01-281-6/+6
| | | | Notes: svn path=/head/; revision=175768
* Uncomment sf(4), sf(4) should work on all architectures.Pyun YongHyeon2008-01-211-1/+1
| | | | Notes: svn path=/head/; revision=175528
* Add COMPAT_FREEBSD7 and enable it in configs that have COMPAT_FREEBSD6.John Baldwin2008-01-071-0/+1
| | | | Notes: svn path=/head/; revision=175147
* Add an access type parameter to pmap_enter(). It will be used to implementAlan Cox2008-01-031-2/+2
| | | | | | | | | | superpage promotion. Correct a style error in kmem_malloc(): pmap_enter()'s last parameter is a Boolean. Notes: svn path=/head/; revision=175067
* Add configuration knobs for the superpage reservation system. Initially,Alan Cox2007-12-271-0/+7
| | | | | | | the reservation will only be enabled on amd64. Notes: svn path=/head/; revision=174938
* Update two tracepoints, i.e., CTRx() invocations, to reflect the demise ofAlan Cox2007-12-272-6/+4
| | | | | | | page coloring a few months ago. Notes: svn path=/head/; revision=174933
* Add a new 'why' argument to kdb_enter(), and a set of constants to useRobert Watson2007-12-253-3/+3
| | | | | | | | | | | | for that argument. This will allow DDB to detect the broad category of reason why the debugger has been entered, which it can use for the purposes of deciding which DDB script to run. Assign approximate why values to all current consumers of the kdb_enter() interface. Notes: svn path=/head/; revision=174898
* Add stubs to unbreak LINT.Joseph Koshy2007-12-071-0/+4
| | | | Notes: svn path=/head/; revision=174405
* Break out stack(9) from ddb(4):Robert Watson2007-12-024-34/+132
| | | | | | | | | | | | | | | | | | | | | | | - Introduce per-architecture stack_machdep.c to hold stack_save(9). - Introduce per-architecture machine/stack.h to capture any common definitions required between db_trace.c and stack_machdep.c. - Add new kernel option "options STACK"; we will build in stack(9) if it is defined, or also if "options DDB" is defined to provide compatibility with existing users of stack(9). Add new stack_save_td(9) function, which allows the capture of a stacktrace of another thread rather than the current thread, which the existing stack_save(9) was limited to. It requires that the thread be neither swapped out nor running, which is the responsibility of the consumer to enforce. Update stack(9) man page. Build tested: amd64, arm, i386, ia64, powerpc, sparc64, sun4v Runtime tested: amd64 (rwatson), arm (cognet), i386 (rwatson) Notes: svn path=/head/; revision=174195
* Fix a non-fatal off-by-one error in the previous revision.Marius Strobl2007-12-011-1/+1
| | | | Notes: svn path=/head/; revision=174134
* - Add the PCI side of the HOST-PCI bridge itself to the bus. ThisMarius Strobl2007-11-303-14/+76
| | | | | | | | | | | | | | is required by the X.Org PCI domains code and additionally needs a workaround for Hummingbird and Sabre bridges as these don't allow their config headers to be read at any width, which is an unusual behavior. - In psycho(4) take advantage of DEFINE_CLASS_0 and use more appropriate types for some softc members. MFC after: 3 days Notes: svn path=/head/; revision=174117
* Make ADAPTIVE_GIANT as the default in the kernel and remove the option.Attilio Rao2007-11-281-1/+0
| | | | | | | | | | | | | Currently, Giant is not too much contented so that it is ok to treact it like any other mutexes. Please don't forget to update your own custom config kernel files. Approved by: cognet, marcel (maintainers of arches where option is not enabled at the moment) Notes: svn path=/head/; revision=174005
* Extend critical section coverage in the low-level interrupt handlers toScott Long2007-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | include the ithread scheduling step. Without this, a preemption might occur in between the interrupt getting masked and the ithread getting scheduled. Since the interrupt handler runs in the context of curthread, the scheudler might see it as having a such a low priority on a busy system that it doesn't get to run for a _long_ time, leaving the interrupt stranded in a disabled state. The only way that the preemption can happen is by a fast/filter handler triggering a schduling event earlier in the handler, so this problem can only happen for cases where an interrupt is being shared by both a fast/filter handler and an ithread handler. Unfortunately, it seems to be common for this sharing to happen with network and USB devices, for example. This fixes many of the mysterious TCP session timeouts and NIC watchdogs that were being reported. Many thanks to Sam Lefler for getting to the bottom of this problem. Reviewed by: jhb, jeff, silby Notes: svn path=/head/; revision=173799
* Let sunkbd(4) emulate an AT keyboard by default.Marius Strobl2007-11-181-0/+2
| | | | | | | | | | | | | | | | | This has the following benefits: - allows to use the AT keyboard maps in share/syscons/keymaps with sunkbd(4), - allows to use kbdmux(4) with sunkbd(4), - allows Sun RS232 keyboards to be configured and used the same way as Sun USB keyboards driven by ukbd(4) (which also does AT keyboard emulation) with X.Org, putting an end to the problem of native support for the former in X.Org being broken over and over again. MFC after: 3 days Notes: svn path=/head/; revision=173735
* Prevent the leakage of wired pages in the following circumstances:Alan Cox2007-11-171-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | First, a file is mmap(2)ed and then mlock(2)ed. Later, it is truncated. Under "normal" circumstances, i.e., when the file is not mlock(2)ed, the pages beyond the EOF are unmapped and freed. However, when the file is mlock(2)ed, the pages beyond the EOF are unmapped but not freed because they have a non-zero wire count. This can be a mistake. Specifically, it is a mistake if the sole reason why the pages are wired is because of wired, managed mappings. Previously, unmapping the pages destroys these wired, managed mappings, but does not reduce the pages' wire count. Consequently, when the file is unmapped, the pages are not unwired because the wired mapping has been destroyed. Moreover, when the vm object is finally destroyed, the pages are leaked because they are still wired. The fix is to reduce the pages' wired count by the number of wired, managed mappings destroyed. To do this, I introduce a new pmap function pmap_page_wired_mappings() that returns the number of managed mappings to the given physical page that are wired, and I use this function in vm_object_page_remove(). Reviewed by: tegge MFC after: 6 weeks Notes: svn path=/head/; revision=173708
* o Rename cpu_thread_setup() to cpu_thread_alloc() to betterMarcel Moolenaar2007-11-141-1/+6
| | | | | | | | | | | | | | | | communicate that it relates to (is called by) thread_alloc() o Add cpu_thread_free() which is called from thread_free() to counter-act cpu_thread_alloc(). i386: Have cpu_thread_free() call cpu_thread_clean() to preserve behaviour. ia64: Have cpu_thread_free() call mtx_destroy() for the mutex initialized in cpu_thread_alloc(). PR: ia64/118024 Notes: svn path=/head/; revision=173615
* Fix for the panic("vm_thread_new: kstack allocation failed") andKonstantin Belousov2007-11-052-2/+7
| | | | | | | | | | | | | | | | | | | | | | | silent NULL pointer dereference in the i386 and sparc64 pmap_pinit() when the kmem_alloc_nofault() failed to allocate address space. Both functions now return error instead of panicing or dereferencing NULL. As consequence, vmspace_exec() and vmspace_unshare() returns the errno int. struct vmspace arg was added to vm_forkproc() to avoid dealing with failed allocation when most of the fork1() job is already done. The kernel stack for the thread is now set up in the thread_alloc(), that itself may return NULL. Also, allocation of the first process thread is performed in the fork1() to properly deal with stack allocation failure. proc_linkup() is separated into proc_linkup() called from fork1(), and proc_linkup0(), that is used to set up the kernel process (was known as swapper). In collaboration with: Peter Holm Reviewed by: jhb Notes: svn path=/head/; revision=173361