summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/include
Commit message (Collapse)AuthorAgeFilesLines
* MFCattilio2011-06-032-1/+62
|\
| * The POWER7 has only 32 SLB slots instead of 64, like other supportednwhitehorn2011-06-021-1/+1
| | | | | | | | | | | | 64-bit PowerPC CPUs. Add infrastructure to support variable numbers of SLB slots and move the user slot from 63 to 0, so that it is always available.
| * MFpseries:nwhitehorn2011-06-021-0/+61
| | | | | | | | | | | | | | | | | | | | Renovate and improve the AIM Open Firmware support: - Add RTAS (Run-Time Abstraction Services) support, found on all IBM systems and some Apple ones - Improve support for 32-bit real mode Open Firmware systems - Pull some more OF bits over from the AIM directory - Fix memory detection on IBM LPARs and systems with more than one /memory node (by andreast@)
| * The P4080 has 8 cores. Bump MAXCPU to 8 to match.marcel2011-05-291-1/+1
| |
| * o Add system versions for the P4040(E) and P4080(E).marcel2011-05-291-0/+4
| | | | | | | | | | | | | | | | | | o In bare_probe(), change the logic that determines the maximum number of processors/cores into a switch statement and take advantage of the fact that bit 3 of the SVR value indicates whether we're running on a security enabled version. Since we don't care about that here, mask the bit. All -E versions are taken care of automatically.
* | MFCattilio2011-05-292-1/+5
|\ \ | |/
* | MFCattilio2011-05-271-2/+10
|\ \ | |/
| * o Swap the SVR numbers for MPC8533 & MPC8533Emarcel2011-05-271-2/+10
| | | | | | | | o Add SVR defines for P1011(E), P1020(E), P2010(E) & P2020(E)
| * Merge r221614,221696,221737,221840 from largeSMP project branch:attilio2011-05-221-258/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite atomic operations for powerpc in order to achieve the following: - Produce a type-clean implementation (in terms of functions arguments and returned values) for the primitives. - Fix errors with _long() atomics where they ended up with the wrong arguments to be accepted. - Follow the sys/type.h specifics that define the numbered types starting from standard C types. - Let _ptr() version to not auto-magically cast arguments, but leave the burden on callers, as _ptr() atomic is intended to be used relatively rarely. Fix cfi in order to support the latest point. In collabouration with: bde Tested by: andreast, nwhitehorn, jceel MFC after: 2 weeks
| * Move the ZERO_REGION_SIZE to a machine-dependent file, as on manymdf2011-05-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | MFCattilio2011-05-131-0/+2
| |
* | Remove strict-aliasing fixup where it is easy to avoid that as it leads toattilio2011-05-101-48/+41
| | | | | | | | | | | | a faster implementation. Requested by: bde
* | Add the powerpc support.attilio2011-05-094-5/+7
| | | | | | | | | | | | | | Note that there is a dirty hack for calling openpic_write(), but nwhitehorn approved it. Discussed with: nwhitehorn
* | - Introduce stubs for type-pun from long to intattilio2011-05-091-154/+129
| | | | | | | | | | | | | | - Don't auto-cast _ptr operations as initially they were intended to be used rarely and consumers had to cast on their own. Reported by: bde, andreast
* | All architectures define the size-bounded types (uint32_t, uint64_t, etc.)attilio2011-05-081-277/+313
|/ | | | | | | | | | | | | starting from base C types (int, long, etc). That is also reflected when building atomic operations, as the size-bounded types are built from the base C types. However, powerpc does the inverse thing, leading to a serie of nasty bugs. Cleanup the atomic implementation by defining as base the base C type version and depending on them, appropriately. Tested by: jceel
* Remove duplicate definition of FIRSTARG.andreast2011-03-171-3/+0
| | | | Approved by: nwhitehorn (mentor)
* Turn off default generation of userland dot symbols on powerpc64 now thatnwhitehorn2011-02-182-15/+9
| | | | | we have a binutils that supports it. Kernel dot symbols remain on to assist DDB.
* Remove pmap fields that are either unused or not fully implemented.alc2011-02-171-7/+0
| | | | Discussed with: kib
* Rename INTR_VEC to MAP_IRQ. From the OFW or FDT we obtain amarcel2011-02-021-1/+1
| | | | | PIC handle with interrupt pin. This we map to the resource called SYS_RES_IRQ.
* Fix the interrupt code, broken 7 months ago. The interrupt frameworkmarcel2011-01-292-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | already supported nested PICs, but was limited to having a nested AT-PIC only. With G5 support the need for nested OpenPIC controllers needed to be added. This was done the wrong way and broke the MPC8555 eval system in the process. OFW, as well as FDT, describe the interrupt routing in terms of a controller and an interrupt pin on it. This needs to be mapped to a flat and global resource: the IRQ. The IRQ is the same as the PCI intline and as such needs to be representable in 8 bits. Secondly, ISA support pretty much dictates that IRQ 0-15 should be reserved for ISA interrupts, because of the internal workins of south bridges. Both were broken. This change reverts revision 209298 for a big part and re-implements it simpler. In particular: o The id() method of the PIC I/F is removed again. It's not needed. o The openpic_attach() function has been changed to take the OFW or FDT phandle of the controller as a second argument. All bus attachments that previously used openpic_attach() as the attach method of the device I/F now implement as bus-specific method and pass the phandle_t to the renamed openpic_attach(). o Change powerpc_register_pic() to take a few more arguments. In particular: - Pass the number of IPIs specificly. The number of IRQs carved out for a PIC is the sum of the number of int. pins and IPIs. - Pass a flag indicating whether the PIC is an AT-PIC or not. This tells the interrupt framework whether to assign IRQ 0-15 or some other range. o Until we implement proper multi-pass bus enumeration, we have to handle the case where we need to map from PIC+pin to IRQ *before* the PIC gets registered. This is done in a similar way as before, but rather than carving out 256 IRQs per PIC, we carve out 128 IRQs (124 pins + 4 IPIs). This is supposed to handle the G5 case, but should really be fixed properly using multiple passes. o Have the interrupt framework set root_pic in most cases and not put that burden in PIC drivers (for the most part). o Remove powerpc_ign_lookup() and replace it with powerpc_get_irq(). Remove IGN_SHIFT, INTR_INTLINE and INTR_IGN. Related to the above, fix the Freescale PCI controller driver, broken by the FDT code. Besides not attaching properly, bus numbers were assigned improperly and enumeration was broken in general. This prevented the AT PIC from being discovered and interrupt routing to work properly. Consequently, the ata(4) controller stopped functioning. Fix the driver, and FDT PCI support, enough to get the MPC8555CDS going again. The FDT PCI code needs a whole lot more work. No breakages are expected, but lackiong G5 hardware, it's possible that there are unpleasant side-effects. At least MPC85xx support is back to where it was 7 months ago -- it's amazing how badly support can be broken in just 7 months... Sponsored by: Juniper Networks
* Introduce macro FDT_MAP_IRQ to map from an interrupt controller andmarcel2011-01-291-0/+3
| | | | | interrupt pin pair to a global IRQ number. When multiple PICs exist on a board, the interrupt pin alone is not unique.
* Add reader/writer lock around mem_range_attr_get() and mem_range_attr_set().jkim2011-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
* Don't redefine MODINFOMD_BOOTINFO as MODINFOMD_DTBP. Thismarcel2011-01-151-1/+2
| | | | | breaks support for older loaders. Add MODINFOMD_DTBP as a new tag instead.
* Enable shared page for the signal trampolines on PowerPC.kib2011-01-141-3/+5
| | | | Reviewed and tested by: nwhitehorn
* Fix handling of NX pages on capable CPUs. Thanks to kib for prodding menwhitehorn2011-01-131-0/+3
| | | | in the right direction.
* Move repeated MAXSLP definition from machine/vmparam.h to sys/vmmeter.h.kib2011-01-091-11/+0
| | | | | | | Update the outdated comments describing MAXSLP and the process selection algorithm for swap out. Comments wording and reviewed by: alc
* We don't support any floating point types larger than double ondas2011-01-091-1/+1
| | | | powerpc, so DECIMAL_DIG should be 17.
* White space changes to align comments. The mips and powerpc _inttypes.htijl2011-01-081-111/+111
| | | | | | are now exactly the same. Approved by: kib (mentor)
* Rename PRIreg helper macro to PRIptr to better reflect its use. Registerstijl2011-01-081-48/+48
| | | | | | | | | | | | and pointers don't always have the same size, e.g. the __mips_n32 ABI (ILP32) has 64 bit registers but 32 bit pointers. On mips introduce PRIptr to fix the format specifier for (u)intptr_t. Prefix PRI64 and PRIptr with underscores because macro names starting with PRI[a-zX] are reserved for future use. Approved by: kib (mentor)
* On mixed 32/64 bit architectures (mips, powerpc) use __LP64__ rather thantijl2011-01-084-25/+16
| | | | | | | | | | | | | architecture macros (__mips_n64, __powerpc64__) when 64 bit types (and corresponding macros) are different from 32 bit. [1] Correct the type of INT64_MIN, INT64_MAX and UINT64_MAX. Define (U)INTMAX_C as an alias for (U)INT64_C matching the type definition for (u)intmax_t. Do this on all architectures for consistency. Suggested by: bde [1] Approved by: kib (mentor)
* On 32 bit architectures define (u)int64_t as (unsigned) long long insteadtijl2011-01-081-17/+8
| | | | | | | | | | | | | | | | of (unsigned) int __attribute__((__mode__(__DI__))). This aligns better with macros such as (U)INT64_C, (U)INT64_MAX, etc. which assume (u)int64_t has type (unsigned) long long. The mode attribute was used because long long wasn't standardised until C99. Nowadays compilers should support long long and use of the mode attribute is discouraged according to GCC Internals documentation. The type definition has to be marked with __extension__ to support compilation with "-std=c89 -pedantic". Discussed with: bde Approved by: kib (mentor)
* Fix types of some values in machine/_limits.h.tijl2011-01-081-6/+4
| | | | | | | | | | | | | | | | | On some architectures UCHAR_MAX and USHRT_MAX had type unsigned int. However, lacking integer suffixes for types smaller than int, their type should correspond to that of an object of type unsigned char (or short) when used in an expression with objects of type int. In that case unsigned char (short) are promoted to int (i.e. signed) so the type of UCHAR_MAX and USHRT_MAX should also be int. Where MIN/MAX constants implicitly have the correct type the suffix has been removed. While here, correct some comments. Reviewed by: bde Approved by: kib (mentor)
* Remove unused support for 64 bit long on 32 bit architectures.tijl2011-01-071-6/+3
| | | | | | | | It was used mainly to discover and fix some 64-bit portability problems before 64-bit arches were widely available. Discussed with: bde Approved by: kib (mentor)
* Add AT_STACKPROT elf aux vector. Will be used to inform rtld about thekib2011-01-071-1/+2
| | | | initial stack protection set by the kernel image activator.
* Import support for the Sony Playstation 3 using the OtherOS featurenwhitehorn2011-01-061-0/+1
| | | | | | | | | | | | available on firmwares 3.15 and earlier. Caveats: Support for the internal SATA controller is currently missing, as is support for framebuffer resolutions other than 720x480. These deficiencies will be remedied soon. Special thanks to Peter Grehan for providing the hardware that made this port possible, and thanks to Geoff Levand of Sony Computer Entertainment for advice on the LV1 hypervisor.
* Memory can be laid out with large gaps on 64-bit PowerPC, so switch tonwhitehorn2010-12-201-1/+6
| | | | VM_PHYSSEG_SPARSE.
* Switch which software-reserved bit is used to designate a locked PTEnwhitehorn2010-12-051-2/+2
| | | | | to correspond to the definition used by the PAPR spec so that its PTE insertion algorithm will properly respect it.
* Add an abstraction layer to the 64-bit AIM MMU's page table manipulationnwhitehorn2010-12-041-0/+19
| | | | | | | | | logic to support modifying the page table through a hypervisor. This uses KOBJ inheritance to provide subclasses of the base 64-bit AIM MMU class with additional methods for page table manipulation. Many thanks to Peter Grehan for suggesting this design and implementing the MMU KOBJ inheritance mechanism.
* Provide a simple IOMMU framework on PowerPC, which is required to supportnwhitehorn2010-12-031-0/+4
| | | | PPC hypervisors.
* Revert r216134. This checkin broke platforms where bus_space are macros:brucec2010-12-031-69/+11
| | | | | they need to be a single statement, and do { } while (0) doesn't work in this situation so revert until a solution can be devised.
* Disallow passing in a count of zero bytes to the bus_space(9) functions.brucec2010-12-021-11/+69
| | | | | | | | | Passing a count of zero on i386 and amd64 for [I386|AMD64]_BUS_SPACE_MEM causes a crash/hang since the 'loop' instruction decrements the counter before checking if it's zero. PR: kern/80980 Discussed with: jhb
* Define bswap macros for constants to allow the compiler to pre-computenwhitehorn2010-12-021-16/+30
| | | | | | | | byte-swapped versions of compile-time constants. This allows use of bswap() and htole*() in initializers, which is required to cross-build btxld. Obtained from: sparc64
* Add CPU support code for the IBM Cell Broadband Engine.nwhitehorn2010-11-122-0/+15
|
* Add some platform KOBJ extensions and continue integrating PowerPCnwhitehorn2010-11-121-0/+1
| | | | | | | | | | hypervisor infrastructure support: - Fix coexistence of multiple platform modules in the same kernel - Allow platform modules to provide an SMP topology - PowerPC hypervisors limit the amount of memory accessible in real mode. Allow the platform modules to specify the maximum real-mode address, and modify the bits of the kernel that need to allocate real-mode-accessible buffers to respect this limits.
* Use local TLB_UNLOCKED marker instead of MTX_UNOWNED for Book-E PowerPC trapraj2010-11-111-0/+5
| | | | | | | | | | routines. This unbreaks Book-E build after the recent machine/mutex.h removal. While there move tlb_*lock() prototypes to machine/tlb.h. Submitted by: jhb
* - Remove <machine/mutex.h>. Most of the headers were empty, and thejhb2010-11-091-67/+0
| | | | | | | | | | | | contents of the ones that were not empty were stale and unused. - Now that <machine/mutex.h> no longer exists, there is no need to allow it to override various helper macros in <sys/mutex.h>. - Rename various helper macros for low-level operations on mutexes to live in the _mtx_* or __mtx_* namespaces. While here, change the names to more closely match the real API functions they are backing. - Drop support for including <sys/mutex.h> in assembly source files. Suggested by: bde (1, 2)
* Restructure the way the copyin/copyout segment is stored to prevent anwhitehorn2010-10-303-5/+7
| | | | | | | | | | | | | | | | | concurrency bug. Since all SLB/SR entries were invalidated during an exception, a decrementer exception could cause the user segment to be invalidated during a copyin()/copyout() without a thread switch that would cause it to be restored from the PCB, potentially causing the operation to continue on invalid memory. This is now handled by explicit restoration of segment 12 from the PCB on 32-bit systems and a check in the Data Segment Exception handler on 64-bit. While here, cause copyin()/copyout() to check whether the requested user segment is already installed, saving some pipeline flushes, and fix the synchronization primitives around the mtsr and slbmte instructions to prevent accessing stale segments. MFC after: 2 weeks
* Handle vector assist traps without a kernel panic, by setting denormalizednwhitehorn2010-10-053-2/+8
| | | | | | | | values to zero. A correct solution would involve emulating vector operations on denormalized values, but this has little effect on accuracy and is much less complicated for now. MFC after: 2 weeks
* Add a memory-range interface to /dev/mem on PowerPC using PAT attributes.nwhitehorn2010-10-031-1/+1
| | | | | | | | | Unlike actual MTRR, this only controls the mapping attributes for subsequent mmap() of /dev/mem. Nonetheless, the support is sufficiently MTRR-like that Xorg can use it, which translates into an enormous increase in graphics performance on PowerPC. MFC after: 2 weeks
* Add support for memory attributes (pmap_mapdev_attr() and friends) onnwhitehorn2010-09-302-9/+13
| | | | | PowerPC/AIM. This is currently stubbed out on Book-E, since I have no idea how to implement it there.
OpenPOWER on IntegriCloud