Commit Graph

27 Commits

Author SHA1 Message Date
mrg 401b5ab713 avoid some uninitialised variable warnings from GCC 4.5. i'm pretty
sure they can't happen in practise, but i can see why GCC isn't sure.
2011-07-02 13:08:25 +00:00
rjs 0b2b1f96e7 Make it compile when PIC_DEBUG is defined. 2011-06-21 18:02:43 +00:00
matt bc7ec3365b Cleanup includes. Explicitly include <powerpc/psl.h> 2011-06-20 06:23:52 +00:00
matt 74692028f6 <arch/powerpc/... -> <powerpc/... 2011-06-20 06:21:45 +00:00
matt 1fd2c684c9 Use <sys/foo.h> instead of <machine/foo.h> if such a file exists.
Don't assume <sys/cpu.h> includes <powerpc/subarch/cpu*.h>.  Include it
explicitly.
2011-06-18 06:41:41 +00:00
matt e2a71f6c7b intr.h must not include cpu due to deadly embrace with SOFTINT_COUNT.
Cleanup intr.h so MD definitions can overload common definitions.
Rototill pic/intr.c.  Virtual IRQs can now be reclaimed.  separate virq
from hwirq from picirq.  Redo intr mask calculations.
tested on pmppc and macppc (MP).
2011-06-17 23:36:17 +00:00
matt 06d8da7df3 Change from level to ipl since we aren't dealing a mask anymore, just a
simple value.
Fix intr_calculatemasks to deal with ipl isn't a mask.  Let establish
and disestablish determine the highest ipl for the interrut source being
modified.  No reason to recompute that for every source when only one changes
at a time.  Only change idepth while in the loop.
2011-06-17 05:15:22 +00:00
matt a7bfd4d42c Make sure OEA ports without __HAVE_FAST_SOFTINTS still compile. 2011-06-16 04:37:48 +00:00
macallan b5ffed7530 enable FAST_SOFTINTR support for all ports that use powerpc/pic/
This has been successfully tested on macppc
TODO:
- ibm4xx needs to be adapted
- SMP doesn't work yet, 2nd CPU crashes when trying to leave the idle loop
2011-06-16 02:43:42 +00:00
matt 01fd92550a Remove <machine/atomic.h>; use <sys/atomic.h> instead.
Add <powerpc/cpuset.h> (for mpc85xx pmap).
Add some initial MP code for mpc85xx
Rework ipi code to be common across all ppcs
Change PPC to keep curlwp in %r13 while in the kernel.
Move astpending from cpu_info to mdlwp
Improve cpu_need_resched to be more MP friendly.
2011-06-05 16:52:22 +00:00
matt f36a02e8b0 Move powerpc to use pcu to manage FPU/AltiVec/SPE. 2011-05-02 02:01:32 +00:00
matt 98933d17d4 Fix some fallout from building the macppc GENERIC.MP. 2011-01-18 02:25:42 +00:00
matt 6a66466f0c Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits.  Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
2010-12-20 00:25:23 +00:00
rmind f66e2cf323 Add missing sys/xcall.h inclusion, remove sys/malloc.h one. 2010-06-25 19:00:05 +00:00
rmind 1840edb963 Implement high priority (XC_HIGHPRI) xcall(9) mechanism - a facility
to execute functions from software interrupt context, at SOFTINT_CLOCK.
Functions must be lightweight.  Will be used for passive serialization.

OK ad@.
2010-06-22 18:29:01 +00:00
macallan 085d3a8922 make this work again 2010-05-12 06:11:31 +00:00
kiyohara a7fd2c6cc1 Support 64-bit imask for powerpc/pic. 2010-04-24 09:39:56 +00:00
kiyohara ca66853e78 Remove white-spaces. 2010-03-10 18:28:30 +00:00
nisimura 6d35cad5db - Have pic_mpcsoc.c to adapt variations of Moto/Freescale OpenPIC
compliant interrupt controllers.  Mostly the refrain of pic_openpic.c
and shall be useful for 85xx/86xx/QorIQ and Tundra product lines.
2009-08-19 06:22:54 +00:00
martin 5d1469bd77 Backout previous: the license sweep touched these files in error, so
restore the old license.
2008-05-10 15:31:03 +00:00
martin 3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
garbled 9792283735 SMP support for ofppc. (finally) Much thanks to Matt Thomas for help in
figuring out all the crazy nuances of getting this working, and to
Michael Lorenz for testing/fixing my changes on macppc.  Tested with a
quad-proc 7044-270.
Summary of changes:

Bumped CPU_MAXNUM to 16 on ofppc.
Added md_* routines to ofppc/cpu.c, to sync the timebase, and awaken the CPUs.
Fixed a bug in the test for a 64bit bridge cpu early in locore.S
Added code to set the interrupt priority for all CPUs with an openpic.
Change rtas to probe before cpus, to allow use of the rtas freeze/thaw
timebase code routines.
Fix CPU_INFO_FOREACH macro to iterate through detected cpus, not CPU_MAXNUM.
Change most uses of ci_cpuid to ci_index, to deal with CPUs that do not allow
writing to SPR_PIR.  Don't write SPR_PIR unless the secondary cpu identifies
itself as 0.
Change the hatchstack/interrupt stack allocations to allocate a 8192byte
interrupt stack, and a 4096 byte hatch stack, align them to 16 bytes, and
allocate them no lower than 0x10000.  Allocate them separately to prevent the
hatch stack corrupting the interrupt stack later on.
If the CPU is a 64bit cpu, copy SPR_ASR in cpu_hatch()
Set the idle stack to ci->ci_data.cpu_idlelwp->l_addr->u_pcb.pcb_sp.
Add OF_start_cpu().  Add a routine to ofwoea_initppc to spin up secondary
procs early, and place them into a spinloop waiting for the hatch routines
to be ready.
Modify the ipi routines to deal with openpics that reverse byte order on read
from an ipi register. (such as on the 7044)
Change the rtas setup to allocate the rtas physical base address above
the kernel, to avoid mucking up the hatch/interrupt stacks.
2008-04-08 02:33:03 +00:00
garbled 80a83a2b7e Add support to ofppc for the IBM 7044-270 machine. This is a POWER3-II
based machine.  Currently the kernel to run on this machine is
incompatible with the standard GENERIC kernel, so for now, we have a
separate GENERIC_B64. Eventually, I hope to combine the two.

Please note, this is a port of 32bit ofppc, not a powerpc64 port.

Thanks to Matt Thomas and Kevin Bowling for helping to make this port
possible.

Summary of changes:

Change ofwpci to use the ofmethod config for configuring the PCI bus,
rather than indirect configuration.
Move the wiring of the interrupt controllers from at the start of the
boot, into the configuration of the first PCI bus.
Rewrite the map_isa_ioregs() hack to work on a machine without BATs
Fix a ton of bugs in the genofw_find_pics routine, and in the map_space code.
Split the pic_openpic into openpic_common and pic_openpic.
Create a new pic_distopenpic driver, for the distributed openpic found on
some newer IBM machines.
Fix a bad panic in pmap_extract on 64bit bridge mode
2008-01-17 23:42:57 +00:00
garbled 76a99a952a Fix the endless stream of 7's problem on i8259-like interrupt controllers
once and for all.  The i8259 does not like to be read in a loop, when an
interrupt comes in, it will return a valid value, however, if you keep
reading it until there are no outstanding interrupts, it will return 7
(which is the lpt interrupt).  Change the pic handler to give an argument
to the get_irq functions of mode, which indicates if this is the first
time we are asking, or if we are just rechecking in a loop.  Non-i8259
handlers can safely ignore this argument.

Tested to fix the stream of 7's problem on prep and ofppc.  Got rid of
the nasty hack in ofppc with this too, and the prep machine seems to take
less interrupts now, which is a good thing.
2007-12-11 18:04:18 +00:00
ad 4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
garbled d974db0ada Merge the ppcoea-renovation branch to HEAD.
This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree.  Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches.  The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
2007-10-17 19:52:51 +00:00