aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64/include
Commit message (Collapse)AuthorAgeFilesLines
* Remove sparc64 kernel supportWarner Losh2020-02-0396-10229/+0
| | | | | | | | | Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Notes: svn path=/head/; revision=357455
* Introduce vm_page_astate.Mark Johnston2019-12-101-1/+1
| | | | | | | | | | | | | | | | | This is a 32-bit structure embedded in each vm_page, consisting mostly of page queue state. The use of a structure makes it easy to store a snapshot of a page's queue state in a stack variable and use cmpset loops to update that state without requiring the page lock. This change merely adds the structure and updates references to atomic state fields. No functional change intended. Reviewed by: alc, jeff, kib Sponsored by: Netflix, Intel Differential Revision: https://reviews.freebsd.org/D22650 Notes: svn path=/head/; revision=355586
* Regularize my copyright noticeWarner Losh2019-12-041-2/+1
| | | | | | | | | | | | o Remove All Rights Reserved from my notices o imp@FreeBSD.org everywhere o regularize punctiation, eliminate date ranges o Make sure that it's clear that I don't claim All Rights reserved by listing All Rights Reserved on same line as other copyright holders (but not me). Other such holders are also listed last where it's clear. Notes: svn path=/head/; revision=355394
* Port r353622 to sparc64 and arm v4.Konstantin Belousov2019-10-161-0/+1
| | | | | | | | | | Noted by: alc Reviewed by: alc, jeff, markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D22056 Notes: svn path=/head/; revision=353664
* sparc64: use generic sub-word atomic *cmpsetKyle Evans2019-10-021-0/+69
| | | | | | | | | | Most of this diff is refactoring to reduce duplication between the different acq_ and rel_ variants. Differential Revision: https://reviews.freebsd.org/D21822 Notes: svn path=/head/; revision=353017
* Centralize __pcpu definitions.Konstantin Belousov2019-08-291-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | Many extern struct pcpu <something>__pcpu declarations were copied/pasted in sources. The issue is that the definition is MD, but it cannot be provided by machine/pcpu.h due to actual struct pcpu defined in sys/pcpu.h later than the inclusion of machine/pcpu.h. This forced the copying when other code needed direct access to __pcpu. There is no way around it, due to machine/pcpu.h supplying part of struct pcpu fields. To work around the problem, add a new machine/pcpu_aux.h header, which should fill any needed MD definitions after struct pcpu definition is completed. This allows to remove copies of __pcpu spread around the source. Also on x86 it makes it possible to remove work arounds like OFFSETOF_CURTHREAD or clang specific warnings supressions. Reported and tested by: lwhsu, bcran Reviewed by: imp, markj (previous version) Discussed with: jhb Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D21418 Notes: svn path=/head/; revision=351594
* Move phys_avail definition into MI code. It is consumed in the MI layer andJeff Roberson2019-08-161-1/+0
| | | | | | | | | | | doing so adds more flexibility with less redundant code. Reviewed by: jhb, markj, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21250 Notes: svn path=/head/; revision=351108
* amd64 KPTI: add control from procctl(2).Konstantin Belousov2019-03-161-0/+4
| | | | | | | | | | | | | | | | | Add the infrastructure to allow MD procctl(2) commands, and use it to introduce amd64 PTI control and reporting. PTI mode cannot be modified for existing pmap, the knob controls PTI of the new vmspace created on exec. Requested by: jhb Reviewed by: jhb, markj (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D19514 Notes: svn path=/head/; revision=345228
* Add kernel support for Intel userspace protection keys feature onKonstantin Belousov2019-02-201-0/+7
| | | | | | | | | | | | | | | | Skylake Xeons. See SDM rev. 68 Vol 3 4.6.2 Protection Keys and the description of the RDPKRU and WRPKRU instructions. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18893 Notes: svn path=/head/; revision=344353
* Add a KPI for the delay while spinning on a spin lock.John Baldwin2018-11-051-0/+1
| | | | | | | | | | | | | Replace a call to DELAY(1) with a new cpu_lock_delay() KPI. Currently cpu_lock_delay() is defined to DELAY(1) on all platforms. However, platforms with a DELAY() implementation that uses spin locks should implement a custom cpu_lock_delay() doesn't use locks. Reviewed by: kib MFC after: 3 days Notes: svn path=/head/; revision=340164
* Consolidate identical ELF auxargs type defintions.Brooks Davis2018-10-221-31/+0
| | | | | | | | | | | | | | | All platforms except powerpc use the same values and powerpc shares a majority of them. Go ahead and declare AT_NOTELF, AT_UID, and AT_EUID in favor of the unused AT_DCACHEBSIZE, AT_ICACHEBSIZE, and AT_UCACHEBSIZE for powerpc. Reviewed by: jhb, imp Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17397 Notes: svn path=/head/; revision=339625
* Implement atomic_swap_{32,64,int,long,ptr}(9).Marius Strobl2018-07-281-2/+9
| | | | Notes: svn path=/head/; revision=336832
* Fix a typo: change lists to list to match rest of sentence.Warner Losh2018-07-171-1/+1
| | | | | | | | | Also, I misspoke in r336428. Any devices on sparc64 machines on "isa" that can do DMA can do 32-bit address DMA and aren't limited to 24-bits of address. Notes: svn path=/head/; revision=336430
* Remove VM_FREELIST_ISADMAWarner Losh2018-07-171-6/+3
| | | | | | | | Sparc64 doesn't have any devices that do DMA that are attached to isa or ebus, so we don't need a low-memory pool. Notes: svn path=/head/; revision=336428
* Back pcpu zone with domain correct pagesMatt Macy2018-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | - Change pcpu zone consumers to use a stride size of PAGE_SIZE. (defined as UMA_PCPU_ALLOC_SIZE to make future identification easier) - Allocate page from the correct domain for a given cpu. - Don't initialize pc_domain to non-zero value if NUMA is not defined There are some misconceptions surrounding this field. It is the _VM_ NUMA domain and should only ever correspond to valid domain values as understood by the VM. The former slab size of sizeof(struct pcpu) was somewhat arbitrary. The new value is PAGE_SIZE because that's the smallest granularity which the VM can allocate a slab for a given domain. If you have fewer than PAGE_SIZE/8 counters on your system there will be some memory wasted, but this is obviously something where you want the cache line to be coming from the correct domain. Reviewed by: jeff Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15933 Notes: svn path=/head/; revision=336020
* No need to force md code to define a macro that's the same asWarner Losh2018-04-161-2/+0
| | | | | | | _BYTE_ORDER. Use that instead. Notes: svn path=/head/; revision=332563
* amd64: Protect the kernel text, data, and BSS by setting the RW/NX bitsJonathan T. Looney2018-03-061-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | correctly for the data contained on each memory page. There are several components to this change: * Add a variable to indicate the start of the R/W portion of the initial memory. * Stop detecting NX bit support for each AP. Instead, use the value from the BSP and, if supported, activate the feature on the other APs just before loading the correct page table. (Functionally, we already assume that the BSP and all APs had the same support or lack of support for the NX bit.) * Set the RW and NX bits correctly for the kernel text, data, and BSS (subject to some caveats below). * Ensure DDB can write to memory when necessary (such as to set a breakpoint). * Ensure GDB can write to memory when necessary (such as to set a breakpoint). For this purpose, add new MD functions gdb_begin_write() and gdb_end_write() which the GDB support code can call before and after writing to memory. This change is not comprehensive: * It doesn't do anything to protect modules. * It doesn't do anything for kernel memory allocated after the kernel starts running. * In order to avoid excessive memory inefficiency, it may let multiple types of data share a 2M page, and assigns the most permissions needed for data on that page. Reviewed by: jhb, kib Discussed with: emaste MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14282 Notes: svn path=/head/; revision=330539
* Do not include float interfaces when using libsa.Warner Losh2018-02-231-0/+2
| | | | | | | | | | We don't support float in the boot loaders, so don't include interfaces for float or double in systems headers. In addition, take the unusual step of spiking double and float to prevent any more accidental seepage. Notes: svn path=/head/; revision=329859
* Move __va_list and related defines to sys/sys/_types.hWarner Losh2018-02-121-14/+0
| | | | | | | | | | __va_list and related defines are identical in all the ARCH/include/_types.h files. Move them to sys/sys/_types.h Sponsored by: Netflix Notes: svn path=/head/; revision=329165
* We don't support gcc < 4.2.1, so varargs.h now is just #errorWarner Losh2018-02-121-89/+0
| | | | | | | | | | | always. Unifdef for versions prior to 4.2.1 and remove now-unused header files. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14323 Notes: svn path=/head/; revision=329164
* Use standard pattern for stdargs.hWarner Losh2018-02-121-71/+7
| | | | | | | | | | | | We don't support older compilers. Most of the code in these files is for pre-3.0 gcc, which is at least 15 years obsolete. Move to using phk's sys/_stdargs.h for all these platforms. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14323 Notes: svn path=/head/; revision=329163
* Remove SFBUF_OPTIONAL_DIRECT_MAP and such hacks, replacing them across theNathan Whitehorn2018-01-191-3/+5
| | | | | | | | | | | | | | | | | | | kernel by PHYS_TO_DMAP() as previously present on amd64, arm64, riscv, and powerpc64. This introduces a new MI macro (PMAP_HAS_DMAP) that can be evaluated at runtime to determine if the architecture has a direct map; if it does not (or does) unconditionally and PMAP_HAS_DMAP is either 0 or 1, the compiler can remove the conditional logic. As part of this, implement PHYS_TO_DMAP() on sparc64 and mips64, which had similar things but spelled differently. 32-bit MIPS has a partial direct-map that maps poorly to this concept and is unchanged. Reviewed by: kib Suggestions from: marius, alc, kib Runtime tested on: amd64, powerpc64, powerpc, mips64 Notes: svn path=/head/; revision=328168
* sparc64: Update idprom.h.Pedro F. Giffuni2017-12-271-23/+22
| | | | | | | | | | We only take a small part of the NetBSD file in sys/dev/sun/idprom.h. Bring some comments and update the license. Obtained from: NetBSD (CVS rev 1.3) Notes: svn path=/head/; revision=327252
* Remove MD atomic_load_{32,64,int,long,ptr}(9) obsolete since the additionMarius Strobl2017-12-211-5/+0
| | | | | | | of (conflicting) MI ones in r326971. Notes: svn path=/head/; revision=327053
* Add atomic_load(9) and atomic_store(9) operations.Konstantin Belousov2017-12-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | They provide relaxed-ordered atomic access semantic. Due to the FreeBSD memory model, the operations are syntaxical wrappers around the volatile accesses. The volatile qualifier is used to ensure that the access not optimized out and in turn depends on the volatile semantic as implemented by supported compilers. The motivation for adding the operation is to help people coming from other systems or knowing the C11/C++ standards where atomics have special type and require use of the special access operations. It is still the case that FreeBSD requires plain load and stores of aligned integer types to be atomic. Suggested by: jhb Reviewed by: alc, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13534 Notes: svn path=/head/; revision=326971
* SPDX: Consider code from Carnegie-Mellon University.Pedro F. Giffuni2017-11-301-0/+2
| | | | | | | Interesting cases, most likely from CMU Mach sources. Notes: svn path=/head/; revision=326403
* sys/sparc64: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2765-0/+130
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326262
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2021-0/+42
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-181-0/+2
| | | | | | | | | | | | | | | | | | | | The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* Add AT_HWCAP2 ELF auxiliary vector.Michal Meloun2017-10-211-1/+2
| | | | | | | | | | | | | - allocate value for new AT_HWCAP2 auxiliary vector on all platforms. - expand 'struct sysentvec' by new 'u_long *sv_hwcap2', in exactly same way as for AT_HWCAP. MFC after: 1 month Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D12699 Notes: svn path=/head/; revision=324814
* Add AT_HWCAP and AT_EHDRFLAGS on all platforms.John Baldwin2017-09-141-1/+3
| | | | | | | | | | | | | | | | | | A new 'u_long *sv_hwcap' field is added to 'struct sysentvec'. A process ABI can set this field to point to a value holding a mask of architecture-specific CPU feature flags. If an ABI does not wish to supply AT_HWCAP to processes the field can be left as NULL. The support code for AT_EHDRFLAGS was already present on all systems, just the #define was not present. This is a step towards unifying the AT_* constants across platforms. Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12290 Notes: svn path=/head/; revision=323579
* Clean up MD pollution of bus_dma.h:Jason A. Harmening2017-07-011-24/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --Remove special-case handling of sparc64 bus_dmamap* functions. Replace with a more generic mechanism that allows MD busdma implementations to generate inline mapping functions by defining WANT_INLINE_DMAMAP in <machine/bus_dma.h>. This is currently useful for sparc64, x86, and arm64, which all implement non-load dmamap operations as simple wrappers around map objects which may be bus- or device-specific. --Remove NULL-checked bus_dmamap macros. Implement the equivalent NULL checks in the inlined x86 implementation. For non-x86 platforms, these checks are a minor pessimization as those platforms do not currently allow NULL maps. NULL maps were originally allowed on arm64, which appears to have been the motivation behind adding arm[64]-specific barriers to bus_dma.h, but that support was removed in r299463. --Simplify the internal interface used by the bus_dmamap_load* variants and move it to bus_dma_internal.h --Fix some drivers that directly include sys/bus_dma.h despite the recommendations of bus_dma(9) Reviewed by: kib (previous revision), marius Differential Revision: https://reviews.freebsd.org/D10729 Notes: svn path=/head/; revision=320528
* Make struct syscall_args visible to userspace compilation environmentKonstantin Belousov2017-06-121-7/+7
| | | | | | | | | | | | from machine/proc.h, consistently on all architectures. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 3 weeks X-Differential revision: https://reviews.freebsd.org/D11080 Notes: svn path=/head/; revision=319871
* fix sparc64 build by restoring 'register' in pcpu.hEd Maste2017-05-171-2/+2
| | | | | | | | Reported by: jhb Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=318412
* Remove register keyword from sys/ and ANSIfy prototypesEd Maste2017-05-171-2/+2
| | | | | | | | | | | | | | | A long long time ago the register keyword told the compiler to store the corresponding variable in a CPU register, but it is not relevant for any compiler used in the FreeBSD world today. ANSIfy related prototypes while here. Reviewed by: cem, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10193 Notes: svn path=/head/; revision=318389
* - Remove 'struct vmmeter' from 'struct pcpu', leaving only global vmmeterGleb Smirnoff2017-04-172-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | in place. To do per-cpu stats, convert all fields that previously were maintained in the vmmeters that sit in pcpus to counter(9). - Since some vmmeter stats may be touched at very early stages of boot, before we have set up UMA and we can do counter_u64_alloc(), provide an early counter mechanism: o Leave one spare uint64_t in struct pcpu, named pc_early_dummy_counter. o Point counter(9) fields of vmmeter to pcpu[0].pc_early_dummy_counter, so that at early stages of boot, before counters are allocated we already point to a counter that can be safely written to. o For sparc64 that required a whole dummy pcpu[MAXCPU] array. Further related changes: - Don't include vmmeter.h into pcpu.h. - vm.stats.vm.v_swappgsout and vm.stats.vm.v_swappgsin changed to 64-bit, to match kernel representation. - struct vmmeter hidden under _KERNEL, and only vmstat(1) is an exclusion. This is based on benno@'s 4-year old patch: https://lists.freebsd.org/pipermail/freebsd-arch/2013-July/014471.html Reviewed by: kib, gallatin, marius, lidl Differential Revision: https://reviews.freebsd.org/D10156 Notes: svn path=/head/; revision=317061
* Corrected misspelled versions of rendezvous.Patrick Kelsey2017-04-091-2/+2
| | | | | | | | | | | | The MFC will include a compat definition of smp_no_rendevous_barrier() that calls smp_no_rendezvous_barrier(). Reviewed by: gnn, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10313 Notes: svn path=/head/; revision=316648
* Fix printing of negative offsets (typically from frame pointers) again.Bruce Evans2017-03-261-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I fixed this in 1997, but the fix was over-engineered and fragile and was broken in 2003 if not before. i386 parameters were copied to 8 other arches verbatim, mostly after they stopped working on i386, and mostly without the large comment saying how the values were chosen on i386. powerpc has a non-verbatim copy which just changes the uncritical parameter and seems to add a sign extension bug to it. Just treat negative offsets as offsets if they are no more negative than -db_offset_max (default -64K), and remove all the broken parameters. -64K is not very negative, but it is enough for frame and stack pointer offsets since kernel stacks are small. The over-engineering was mainly to go more negative than -64K for the negative offset format, without affecting printing for more than a single address. Addresses in the top 64K of a (full 32-bit or 64-bit) address space are now printed less well, but there aren't many interesting ones. For arches that have many interesting ones very near the top (e.g., 68k has interrupt vectors there), there would be no good limit for the negative offset format and -64K is a good as anything. Notes: svn path=/head/; revision=316001
* Renumber copyright clause 4Warner Losh2017-02-2815-15/+15
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Bring back r313037, with fixes for mips:Jason A. Harmening2017-02-191-0/+1
| | | | | | | | | | | | Implement get_pcpu() for amd64/sparc64/mips/powerpc, and use it to replace pcpu_find(curcpu) in MI code. Reviewed by: andreast, kan, lidl Tested by: lidl(mips, sparc64), andreast(powerpc) Differential Revision: https://reviews.freebsd.org/D9587 Notes: svn path=/head/; revision=313930
* Define the vm_ooffset_t and vm_pindex_t types as machine-independend.Konstantin Belousov2017-02-041-2/+0
| | | | | | | | | | | | | | The types are for the byte offset and page index in vm object. They are similar to off_t, which is defined as 64bit MI integer. Using MI definitions will allow to provide consistent MD values of vm object-related maximum sizes. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=313194
* Revert r313037Jason A. Harmening2017-02-041-1/+0
| | | | | | | | | | The switch to get_pcpu() in MI code seems to cause hangs on MIPS. Back out until we can get a better idea of what's happening there. Reported by: kan, lidl Notes: svn path=/head/; revision=313193
* Implement get_pcpu() for the remaining architectures and use it toJason A. Harmening2017-02-011-0/+1
| | | | | | | replace pcpu_find(curcpu) in MI code. Notes: svn path=/head/; revision=313037
* sparc64: add atomic_fcmpsetMateusz Guzik2017-01-101-0/+34
| | | | | | | | | Tested on hardware provided by feld. Reviewed by: marius Notes: svn path=/head/; revision=311898
* Fix building on i386 and arm. But 'public domain' headers on the filesWarner Losh2016-10-131-26/+1
| | | | | | | | | | | with no creative content. Include "lost" changes from git: o Use /dev/efi instead of /dev/efidev o Remove redundant NULL checks. Submitted by: kib@, dim@, zbb@, emaste@ Notes: svn path=/head/; revision=307189
* Include stubs even on the platforms we don't support so libsysdecodeWarner Losh2016-10-111-0/+39
| | | | | | | continues to build. Notes: svn path=/head/; revision=307074
* Add new bus methods for mapping resources.John Baldwin2016-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a pair of bus methods that can be used to "map" resources for direct CPU access using bus_space(9). bus_map_resource() creates a mapping and bus_unmap_resource() releases a previously created mapping. Mappings are described by 'struct resource_map' object. Pointers to these objects can be passed as the first argument to the bus_space wrapper API used for bus resources. Drivers that wish to map all of a resource using default settings (for example, using uncacheable memory attributes) do not need to change. However, drivers that wish to use non-default settings can now do so without jumping through hoops. First, an RF_UNMAPPED flag is added to request that a resource is not implicitly mapped with the default settings when it is activated. This permits other activation steps (such as enabling I/O or memory decoding in a device's PCI command register) to be taken without creating a mapping. Right now the AGP drivers don't set RF_ACTIVE to avoid using up a large amount of KVA to map the AGP aperture on 32-bit platforms. Once RF_UNMAPPED is supported on all platforms that support AGP this can be changed to using RF_UNMAPPED with RF_ACTIVE instead. Second, bus_map_resource accepts an optional structure that defines additional settings for a given mapping. For example, a driver can now request to map only a subset of a resource instead of the entire range. The AGP driver could also use this to only map the first page of the aperture (IIRC, it calls pmap_mapdev() directly to map the first page currently). I will also eventually change the PCI-PCI bridge driver to request mappings of the subset of the I/O window resource on its parent side to create mappings for child devices rather than passing child resources directly up to nexus to be mapped. This also permits bridges that do address translation to request suitable mappings from a resource on the "upper" side of the bus when mapping resources on the "lower" side of the bus. Another attribute that can be specified is an alternate memory attribute for memory-mapped resources. This can be used to request a Write-Combining mapping of a PCI BAR in an MI fashion. (Currently the drivers that do this call pmap_change_attr() directly for x86 only.) Note that this commit only adds the MI framework. Each platform needs to add support for handling RF_UNMAPPED and thew new bus_map/unmap_resource methods. Generally speaking, any drivers that are calling rman_set_bustag() and rman_set_bushandle() need to be updated. Discussed on: arch Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D5237 Notes: svn path=/head/; revision=300317
* Since r296250 it is no longer possible for devices to use bus spaceMarius Strobl2016-04-101-1/+1
| | | | | | | | | | | | | | | | | | | addresses exceeding 32 bit, so bump BUS_SPACE_MAXADDR to 64 bit. The whole situation is sub par, though; prior to r296250 and despite what their names imply, BUS_SPACE_MAX* were primarily, even almost exclusively used for bus_dma(9). Now these macros also have a vital role for bus_space(9). However, it does not necessarily hold that both bus DMA and space addresses universally have the same limits per platform. As for sparc64, 64 bit clearly is beyond what can be addressed via the various IOMMUs. With this change in place, we now rely on the parent bus DMA tags of the host-to-foo drivers causing the child tags to be capped as necessary. PR: 207998 Notes: svn path=/head/; revision=297792
* POSIX states that #include <signal.h> shall make both mcontext_t andKonstantin Belousov2016-02-121-5/+5
| | | | | | | | | | | | | | | | | | | | | | | ucontext_t available. Our code even has XXX comment about this. Add a bit of compliance by moving struct __ucontext definition into sys/_ucontext.h and including it into signal.h and sys/ucontext.h. Several machine/ucontext.h headers were changed to use namespace-safe types (like uint64_t->__uint64_t) to not depend on sys/types.h. struct __stack_t from sys/signal.h is made always visible in private namespace to satisfy sys/_ucontext.h requirements. Apparently mips _types.h pollutes global namespace with f_register_t type definition. This commit does not try to fix the issue. PR: 207079 Reported and tested by: Ting-Wei Lan <lantw44@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=295561
* Add an atomic_fetchadd_64() wrapper on sparc64.John Baldwin2016-01-221-0/+1
| | | | | | | Reviewed by: marius Notes: svn path=/head/; revision=294539