summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/include
Commit message (Collapse)AuthorAgeFilesLines
* Replace __signed by signed.ed2011-12-131-1/+1
| | | | | The signed keyword is an integral part of the C syntax. There's no need to use __signed.
* Increase the available virtual address space for user programs on PowerPCnwhitehorn2011-12-111-7/+12
| | | | | | AIM systems to 4 GB on 32-bit systems and 2^64 bytes on 64-bit systems. VM_MAXUSER_ADDRESS remains at 2 GB on pending Book-E, pending review of an increase to 3 GB by those more familiar with Book-E.
* Keep track of PVO entries in each pmap, which allows much fasternwhitehorn2011-12-111-17/+19
| | | | | | | pmap_remove() for large sparse requests. This can prevent pmap_remove() operations on 64-bit process destruction or swapout that would take several hundred times the lifetime of the universe to complete. This behavior is largely indistinguishable from a hang.
* Use a global __pure2 function instead of a global register variable fornwhitehorn2011-11-171-4/+11
| | | | | curthread, like on x86 and sparc64. This makes the kernel somewhat more clang friendly, which doesn't support global register variables.
* People porting FreeBSD to new architectures ought not have todas2011-10-211-0/+10
| | | | | | | | | | | | | 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.
* Remove unused define.kib2011-10-071-1/+0
| | | | MFC after: 1 month
* - Move the PG_UNMANAGED flag from m->flags to m->oflags, renaming the flagkib2011-08-091-2/+0
| | | | | | | | | | | | | | to VPO_UNMANAGED (and also making the flag protected by the vm object lock, instead of vm page queue lock). - Mark the fake pages with both PG_FICTITIOUS (as it is now) and VPO_UNMANAGED. As a consequence, pmap code now can use use just VPO_UNMANAGED to decide whether the page is unmanaged. Reviewed by: alc Tested by: pho (x86, previous version), marius (sparc64), marcel (arm, ia64, powerpc), ray (mips) Sponsored by: The FreeBSD Foundation Approved by: re (bz)
* Add the possibility to specify from kernel configs MAXCPU value.attilio2011-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)
* Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for ppc64)nwhitehorn2011-06-231-0/+8
| | | | | | | | | | | | | | | instead of a PCPU field for curthread. This averts a race on SMP systems with a high interrupt rate where the thread looking up the value of curthread could be preempted and migrated between obtaining the PCPU pointer and reading the value of pc_curthread, resulting in curthread being observed to be the current thread on the thread's original CPU. This played merry havoc with the system, in particular with mutexes. Many thanks to jhb for helping me work this one out. Note that Book-E is in principle susceptible to the same problem, but has not been modified yet due to lack of Book-E hardware. MFC after: 2 weeks
* 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
OpenPOWER on IntegriCloud