aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64/include
Commit message (Collapse)AuthorAgeFilesLines
* Replace all uses of the vm page queues lock by a r/w lock that is privateAlan Cox2012-05-291-0/+2
| | | | | | | | | | | | | | | | to this pmap.c. This new r/w lock is used primarily to synchronize access to the TTE lists. However, it will be used in a somewhat unconventional way. As finer-grained TTE list locking is added to each of the pmap functions that acquire this r/w lock, its acquisition will be changed from write to read, enabling concurrent execution of the pmap functions with finer-grained locking. Reviewed by: attilio Tested by: flo MFC after: 10 days Notes: svn path=/head/; revision=236214
* MFp4 bz_ipv6_fast:Bjoern A. Zeeb2012-05-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | in_cksum.h required ip.h to be included for struct ip. To be able to use some general checksum functions like in_addword() in a non-IPv4 context, limit the (also exported to user space) IPv4 specific functions to the times, when the ip.h header is present and IPVERSION is defined (to 4). We should consider more general checksum (updating) functions to also allow easier incremental checksum updates in the L3/4 stack and firewalls, as well as ponder further requirements by certain NIC drivers needing slightly different pseudo values in offloading cases. Thinking in terms of a better "library". Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn (as part of the whole) MFC After: 3 days Notes: svn path=/head/; revision=235941
* Fix mismerge in r235231.Marius Strobl2012-05-101-1/+1
| | | | Notes: svn path=/head/; revision=235232
* Merge r234989 from x86:Marius Strobl2012-05-101-0/+2
| | | | | | | Revert part of r234723 by re-enabling the SMP protection for intr_bind(). Notes: svn path=/head/; revision=235231
* Add a convenience macro for the returns_twice attribute, and apply it toDimitry Andric2012-04-291-1/+1
| | | | | | | | | | the prototypes of the appropriate functions (getcontext, savectx, setjmp, sigsetjmp and vfork). MFC after: 2 weeks Notes: svn path=/head/; revision=234785
* Clean up the intr* MD KPI from the SMP dependency, removing a cause ofAttilio Rao2012-04-261-2/+0
| | | | | | | | | | | | | | discrepancy between modules and kernel, but deal with SMP differences within the functions themselves. As an added bonus this also helps in terms of code readability. Requested by: gibbs Reviewed by: jhb, marius MFC after: 1 week Notes: svn path=/head/; revision=234723
* Add casts to __uint16_t to the __bswap16() macros on all arches whichDimitry Andric2012-03-091-2/+2
| | | | | | | | | | | | | | didn't already have them. This is because the ternary expression will return int, due to the Usual Arithmetic Conversions. Such casts are not needed for the 32 and 64 bit variants. While here, add additional parentheses around the x86 variant, to protect against unintended consequences. MFC after: 2 weeks Notes: svn path=/head/; revision=232745
* - Change contigmalloc() to use the vm_paddr_t type instead of an unsignedJohn Baldwin2012-03-011-1/+1
| | | | | | | | | | | | | | | | | | long for specifying a boundary constraint. - Change bus_dma tags to use bus_addr_t instead of bus_size_t for boundary constraints. These allow boundary constraints to be fully expressed for cases where sizeof(bus_addr_t) != sizeof(bus_size_t). Specifically, it allows a driver to properly specify a 4GB boundary in a PAE kernel. Note that this cannot be safely MFC'd without a lot of compat shims due to KBI changes, so I do not intend to merge it. Reviewed by: scottl Notes: svn path=/head/; revision=232356
* Now that we have a working OF_printf() since r230631 and a OF_panic()Marius Strobl2012-01-271-29/+1
| | | | | | | | | | | | | | | | | | | helper since r230632, use these for output and panicing during the early cycles and move cninit() until after the static per-CPU data has been set up. This solves a couple of issue regarding the non- availability of the static per-CPU data: - panic() not working and only making things worse when called, - having to supply a special DELAY() implementation to the low-level console drivers, - curthread accesses of mutex(9) usage in low-level console drivers that aren't conditional due to compiler optimizations (basically, this is the problem described in r227537 but in this case for keyboards attached via uart(4)). [1] PR: 164123 [1] Notes: svn path=/head/; revision=230633
* - Now that we have a working OF_printf() since r230631, use it forMarius Strobl2012-01-271-2/+3
| | | | | | | | | implementing a simple OF_panic() that may be used during the early cycles when panic() isn't available, yet. - Mark cpu_{exit,shutdown}() as __dead2 as appropriate. Notes: svn path=/head/; revision=230632
* For machines where the kernel address space is unrestricted increaseMarius Strobl2012-01-271-1/+1
| | | | | | | | | | | | | VM_KMEM_SIZE_SCALE to 2, awaiting more insight from alc@. As it turns out, the VM apparently has problems with machines that have large holes in the physical address space, causing the kmem_suballoc() call in kmeminit() to fail with a VM_KMEM_SIZE_SCALE of 1. Using a value of 2 allows these, namely Blade 1500 with 2GB of RAM, to boot. PR: 164227 Notes: svn path=/head/; revision=230630
* Mark cpu_{halt,reset}() as __dead2 as appropriate.Marius Strobl2012-01-271-2/+2
| | | | Notes: svn path=/head/; revision=230628
* Add C11 macros describing subnormal numbers to float.h.David Schultz2012-01-231-0/+15
| | | | | | | Reviewed by: bde Notes: svn path=/head/; revision=230475
* Replace __signed by signed.Ed Schouten2011-12-131-1/+1
| | | | | | | | The signed keyword is an integral part of the C syntax. There's no need to use __signed. Notes: svn path=/head/; revision=228469
* Revert r225889 a bit. While it's correct that in total store order there'sMarius Strobl2011-12-031-1/+4
| | | | | | | | | no need to additionally add CPU memory barriers to the acquire variants of atomic(9), these are documented to also include compiler memory barriers. So add the latter, which were previously included by using membar(), back. Notes: svn path=/head/; revision=228222
* For sparc64 also adjust the geometry of da(4) driven disks to not overflowMarius Strobl2011-11-271-3/+4
| | | | | | | | | | | | | | the 16-bit cylinders field of the VTOC8 disk label (at around 502GB). The geometry chosen for disks above that limit allows to use disks up to 2TB, which is the limit of the extended VTOC8 format. The geometry used for disks smaller than the 16-bit cylinders limit stays the same as used by cam_calc_geometry(9) for extended translation. Thanks to Hans-Joerg Sirtl for providing hardware for testing this change. MFC after: 3 days Notes: svn path=/head/; revision=228022
* Define curthread as an inline function that loads the thread pointerMarius Strobl2011-11-151-0/+10
| | | | | | | | | | | directly from g7, the pcpu pointer. This guarantees correct behavior when the thread migrates to a different CPU. Commit message stolen from r205431. Additional testing by Peter Jeremy. MFC after: 3 days Notes: svn path=/head/; revision=227539
* People porting FreeBSD to new architectures ought not have toDavid Schultz2011-10-211-0/+11
| | | | | | | | | | | | | | | | implement a deprecated FPU control interface in addition to the standard one. To make this clearer, further deprecate ieeefp.h by not declaring the function prototypes except on architectures that implement them already. Currently i386 and amd64 implement the ieeefp.h interface for compatibility, and for fp[gs]etprec(), which doesn't exist on most other hardware. Powerpc, sparc64, and ia64 partially implement it and probably shouldn't, and other architectures don't implement it at all. Notes: svn path=/head/; revision=226607
* Remove unused define.Konstantin Belousov2011-10-071-1/+0
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=226112
* - Use atomic operations rather than sched_lock for safely assigning pm_activeMarius Strobl2011-10-061-0/+59
| | | | | | | | | | | and pc_pmap for SMP. This is key to allowing adding support for SCHED_ULE. Thanks go to Peter Jeremy for additional testing. - Add support for SCHED_ULE to cpu_switch(). Committed from: 201110DevSummit Notes: svn path=/head/; revision=226054
* Make sparc64 compatible with NEW_PCIB and enable it:Marius Strobl2011-10-022-24/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Implement bus_adjust_resource() methods as far as necessary and in non-PCI bridge drivers as far as feasible without rototilling them. - As NEW_PCIB does a layering violation by activating resources at layers above pci(4) without previously bubbling up their allocation there, move the assignment of bus tags and handles from the bus_alloc_resource() to the bus_activate_resource() methods like at least the other NEW_PCIB enabled architectures do. This is somewhat unfortunate as previously sparc64 (ab)used resource activation to indicate whether SYS_RES_MEMORY resources should be mapped into KVA, which is only necessary if their going to be accessed via the pointer returned from rman_get_virtual() but not for bus_space(9) as the later always uses physical access on sparc64. Besides wasting KVA if we always map in SYS_RES_MEMORY resources, a driver also may deliberately not map them in if the firmware already has done so, possibly in a special way. So in order to still allow a driver to decide whether a SYS_RES_MEMORY resource should be mapped into KVA we let it indicate that by calling bus_space_map(9) with BUS_SPACE_MAP_LINEAR as actually documented in the bus_space(9) page. This is implemented by allocating a separate bus tag per SYS_RES_MEMORY resource and passing the resource via the previously unused bus tag cookie so we later on can call rman_set_virtual() in sparc64_bus_mem_map(). As a side effect this now also allows to actually indicate that a SYS_RES_MEMORY resource should be mapped in as cacheable and/or read-only via BUS_SPACE_MAP_CACHEABLE and BUS_SPACE_MAP_READONLY respectively. - Do some minor cleanup like taking advantage of rman_init_from_resource(), factor out the common part of bus tag allocation into a newly added sparc64_alloc_bus_tag(), hook up some missing newbus methods and replace some homegrown versions with the generic counterparts etc. - While at it, let apb_attach() (which can't use the generic NEW_PCIB code as APB bridges just don't have the base and limit registers implemented) regarding the config space registers cached in pcib_softc and the SYSCTL reporting nodes set up. Notes: svn path=/head/; revision=225931
* - Add protective parentheses to macros as far as possible.Marius Strobl2011-10-011-41/+41
| | | | | | | | - Move {r,w,}mb() to the top of this file where they live on most of the other architectures. Notes: svn path=/head/; revision=225890
* In total store which we use for running the kernel and all of the userlandMarius Strobl2011-10-011-8/+9
| | | | | | | | | | | | | | atomic operations behave as if the were followed by a memory barrier so there's no need to include ones in the acquire variants of atomic(9). Removing these results a small performance improvement, specifically this is sufficient to compensate the performance loss seen in the worldstone benchmark seen when using SCHED_ULE instead of SCHED_4BSD. This change is inspired by Linux even more radically doing the equivalent thing some time ago. Thanks go to Peter Jeremy for additional testing. Notes: svn path=/head/; revision=225889
* Use the extended integer condition code when comparing 64-bit values. GivenMarius Strobl2011-09-301-1/+1
| | | | | | | that ATOMIC_INC_LONG currently is unused this happened to not be fatal. Notes: svn path=/head/; revision=225887
* - Right-justify backslashes as suggested by style(9).Marius Strobl2011-09-301-55/+55
| | | | | | | | - Rename ATOMIC_INC_ULONG to ATOMIC_INC_LONG in order to be consistent with the names of the other macros in this file an adjust accordingly. Notes: svn path=/head/; revision=225886
* Merge from r224217:Marius Strobl2011-07-201-1/+1
| | | | | | | | | Bump MAXCPU to 64. Approved by: re (kib) Notes: svn path=/head/; revision=224232
* Add the possibility to specify from kernel configs MAXCPU value.Attilio Rao2011-07-191-0/+2
| | | | | | | | | | | | | This patch is going to help in cases like mips flavours where you want a more granular support on MAXCPU. No MFC is previewed for this patch. Tested by: pluknet Approved by: re (kib) Notes: svn path=/head/; revision=224207
* - pmap_cache_remove() and pmap_protect_tte() are only used within pmap.cMarius Strobl2011-07-051-3/+0
| | | | | | | | so static'ize them. - Correct a typo. Notes: svn path=/head/; revision=223800
* - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries fromMarius Strobl2011-07-023-5/+20
| | | | | | | | | | | | | | | | | | | | | | the TLBs in order to get rid of the user mappings but instead traverse them an flush only the latter like we also do for the Spitfire-class. Also flushing the unlocked kernel entries can cause instant faults which when called from within cpu_switch() are handled with the scheduler lock held which in turn can cause timeouts on the acquisition of the lock by other CPUs. This was easily seen with a 16-core V890 but occasionally also happened with 2-way machines. While at it, move the SPARC64-V support code entirely to zeus.c. This causes a little bit of duplication but is less confusing than partially using Cheetah-class bits for these. - For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024- entry, 2-way set associative TLB. - In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back. Tested by: Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V) Notes: svn path=/head/; revision=223719
* Fix whitespaceMarius Strobl2011-06-211-5/+5
| | | | Notes: svn path=/head/; revision=223379
* On machines where we don't need to lock the kernel TSB into the dTLB andMarius Strobl2011-06-212-2/+2
| | | | | | | | thus may basically use the entire 64-bit kernel address space reduce VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory. Notes: svn path=/head/; revision=223378
* Don't include curcpu in the mask which is used as the IPI cookie as weMarius Strobl2011-06-151-12/+16
| | | | | | | | | | have to ignore it when sending the IPI anyway. Actually I can't think of a good reason why this ever was done that way in the first place as it's not even usefull for debugging. While at it replace the use of pc_other_cpus as it's slated for deorbit. Notes: svn path=/head/; revision=223126
* Adapt CATR() to r222813. This is somewhat tricky as we can't afford usingMarius Strobl2011-06-071-16/+28
| | | | | | | | | | | | more than three temporary register in several places CATR() is used so this code trades instructions in for registers. Actually, this still isn't sufficient and CATR() has the side-effect of clobbering %y. Luckily, with the current uses of CATR() this either doesn't matter or we are able to (save and) restore it. Now that there's only one use of AND() and TEST() left inline these. Notes: svn path=/head/; revision=222828
* Fix KTR_CPUMASK in order to accept a string representing a cpuset_t.Attilio Rao2011-05-311-0/+2
| | | | | | | | | | | | | | | This introduce all the underlying support for making this possible (via the function cpusetobj_strscan() and keeps ktr_cpumask exported. sparc64 implements its own assembly primitives for tracing events and needs to properly check it. Anyway the sparc64 logic is not implemented yet due to lack of knowledge (by me) and time (by marius), but it is just a matter of using ktr_cpumask when possible. Tested and fixed by: pluknet Reviewed by: marius Notes: svn path=/projects/largeSMP/; revision=222546
* Revert a change that crept in during MFC.Attilio Rao2011-05-311-2/+0
| | | | Notes: svn path=/projects/largeSMP/; revision=222545
* MFCAttilio Rao2011-05-311-0/+2
|\ | | | | | | Notes: svn path=/projects/largeSMP/; revision=222526
* | Revert a patch that unvolountary sneaked in while I was MFCing.Attilio Rao2011-05-231-2/+0
| | | | | | | | Notes: svn path=/projects/largeSMP/; revision=222235
* | MFCAttilio Rao2011-05-231-0/+2
|\| | | | | | | Notes: svn path=/projects/largeSMP/; revision=222209
* | MFCAttilio Rao2011-05-131-0/+7
|\| | | | | | | Notes: svn path=/projects/largeSMP/; revision=221858
| * Move the ZERO_REGION_SIZE to a machine-dependent file, as on manyMatthew D Fleming2011-05-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | architectures (i386, for example) the virtual memory space may be constrained enough that 2MB is a large chunk. Use 64K for arches other than amd64 and ia64, with special handling for sparc64 due to differing hardware. Also commit the comment changes to kmem_init_zero_region() that I missed due to not saving the file. (Darn the unfamiliar development environment). Arch maintainers, please feel free to adjust ZERO_REGION_SIZE as you see fit. Requested by: alc MFC after: 1 week MFC with: r221853 Notes: svn path=/head/; revision=221855
* | MFCAttilio Rao2011-05-121-0/+11
|\| | | | | | | Notes: svn path=/projects/largeSMP/; revision=221810
| * Add an ATOMIC_CLEAR_LONG.Marius Strobl2011-05-101-0/+11
| | | | | | | | Notes: svn path=/head/; revision=221750
* | The ita_mask should include curcpu but the cpuset passed to cpu_ipi_selected()Marius Strobl2011-05-111-3/+3
| | | | | | | | | | | | | | | | | | must not, otherwise we tell the CPU to IPI itself, which the sun4u CPUs don't support. For reasons unknown so far MD and MI IPI use actually still triggers that assertion though. Notes: svn path=/projects/largeSMP/; revision=221791
* | Add sparc64 support.Attilio Rao2011-05-063-20/+31
|/ | | | | | | Compiled (and helped) by: pluknet Notes: svn path=/projects/largeSMP/; revision=221554
* Correct spelling in comments.Marius Strobl2011-04-221-1/+1
| | | | | | | Submitted by: brucec Notes: svn path=/head/; revision=220939
* Remove the advertising clause from the UCB license according to theMarius Strobl2011-03-132-8/+0
| | | | | | | July 22, 1999 addendum. Notes: svn path=/head/; revision=219608
* Sync licenses and the corresponding RCS IDs with NetBSD, mainly switchingMarius Strobl2011-03-126-29/+31
| | | | | | | | | the licenses of Matthew R. Green and the TNF to 2-clause. Obtained from: NetBSD Notes: svn path=/head/; revision=219567
* Fix typos - remove duplicate "the".Rebecca Cran2011-02-211-1/+1
| | | | | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days Notes: svn path=/head/; revision=218909
* Remove pmap fields that are either unused or not fully implemented.Alan Cox2011-02-171-2/+0
| | | | | | | Discussed with: kib Notes: svn path=/head/; revision=218773
* Add reader/writer lock around mem_range_attr_get() and mem_range_attr_set().Jung-uk Kim2011-01-171-1/+4
| | | | | | | | | | | | Compile sys/dev/mem/memutil.c for all supported platforms and remove now unnecessary dev_mem_md_init(). Consistently define mem_range_softc from mem.c for all platforms. Add missing #include guards for machine/memdev.h and sys/memrange.h. Clean up some nearby style(9) nits. MFC after: 1 month Notes: svn path=/head/; revision=217515