Commit Graph

1621 Commits

Author SHA1 Message Date
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
ad
284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
ad
6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +00:00
ad
30abe39468 - Retire SYCALL_MPSAFE. With the exceptions of darwin and irix emulations,
all system calls are now MPSAFE.
- Remove unneeded acquire/release of kernel_lock.
2008-04-24 11:51:18 +00:00
he
157c460048 Need to include <powerpc/psl.h> and <powerpc/frame.h> here to get
PSL_EE and struct intrframe defined.  Fixes build problem for evbppc
EV64260 kernel.
2008-04-24 11:36:51 +00:00
matt
55d5280da2 On MP systems, make sure to update l->l_cpu with the cpu_info of the current
processor (in case it was running on a different processor before).
2008-04-10 23:29:01 +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
matt
666d4c1ddb split device_t/softc. Use device_xname and device_private. 2008-04-04 16:04:19 +00:00
phx
14f850861b SmartFirmware only reports the first 256MB as available.
Also use the remaining memory by looking at the "reg" property.
2008-03-27 18:01:08 +00:00
phx
61737214f3 Restrict RTAS instantiation to the first 256MB. Other memory regions may not
be mapped by OpenFirmware.
2008-03-27 17:54:46 +00:00
cube
607ead0ef4 Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend).  Use proper types and ansify where appropriate.
2008-03-14 15:09:09 +00:00
matt
9b9164cc52 on MP systems, whenever we change a PTE, make to sync the data cache so that
other processors can see the change.
2008-03-11 20:44:01 +00:00
phx
09190f8549 mem*.S no longer include assym.h 2008-03-07 17:10:00 +00:00
mrg
3b5f349b34 insert a .WAIT between include and include/foo subdirs, so that
include/ is created before include/foo.

fixes -j builds on ofppc for me.
2008-03-04 08:12:12 +00:00
matt
a2ce1f327a Make kernlib depend on assym.h 2008-03-03 18:48:26 +00:00
phx
50ea3aad0b Removed the check for device_type==display in rascons_cnattach(). It is not
required, because this function will be called for display-consoles only,
and it allows SmartFirmware to attach a rascons console.
Approved by garbled.
2008-03-03 17:15:57 +00:00
joerg
4e9584ed3b mem*.S needs assym.h. 2008-03-01 16:02:46 +00:00
xtraeme
f402cadf9a Remove CTL_MACHDEP_NAMES, it's not used anywhere.
Ok by martin@.
2008-02-27 18:26:15 +00:00
phx
1ed426bc21 On the Pegasos2, we must never run PCI-configure for the MV64361 host bridge,
otherwise the devices on that bus might no longer work correctly (e.g.
interrupt flood).
Approved by garbled.
2008-02-23 21:11:22 +00:00
matt
beb8ce1f63 Add rw_enter/rw_tryenter/rw_exit stubs (untested). 2008-02-23 19:56:10 +00:00
matt
f0df2a688a Add some 440 definitions 2008-02-23 19:54:54 +00:00
matt
27907c4e8a Use BAT_VA2IDX() 2008-02-23 19:50:41 +00:00
matt
7aa9230dd8 Add BAT_VA2IDX to abstract out the va to index calculation. 2008-02-23 19:48:43 +00:00
matt
21a07206db Add clrr{ptr,long,reg}i, l{ptr,long,reg}arx, st{ptr,long,reg}cx macros 2008-02-23 19:38:47 +00:00
matt
c44a88fb5a Detect HIGHBAT/XBSEN/HIGHSPRG to MPC74[45]x where x > 1
Enable above as appropriate.
2008-02-23 19:37:07 +00:00
matt
c6f7e7c68c Add MTX_* and RW_* definitions 2008-02-23 19:34:53 +00:00
matt
2fb44af084 Add BAT_WIMG and some XBL aware BAT_BL_{512,1G,2G,4G} macros. 2008-02-23 19:28:29 +00:00
matt
e40b7cd828 Add a XBSEN flag for large BATs 2008-02-23 19:23:37 +00:00
drochner
bb33f35f20 Since files.wscons et al. are included by ~all ports anyway, include
them in the mi "files" file, and remove include statements from md files.
These shouldn't pull in additional kernel code when not in use, so it
shouldn't do any harm except a risk of namespace collisions which
should be easy to fix.
2008-02-20 21:43:33 +00:00
phx
46125cb32d A few bug fixes, approved by garbled:
1. The 'S' operand field has to be swapped with the 'A' operand in the
   output, as long as it is not a store-instruction. To achieve that, I
   have introduced a new operand type Op_ST for the store instructions.
2. srawi has an immediate shift count as third operand, not a register.
3. extsh has only two operands, not three.
2008-02-20 19:12:13 +00:00
phx
55ec696662 Fixed compilation with DEBUG option for PMAP_OEA64_BRIDGE.
Approved by garbled.
2008-02-17 18:16:42 +00:00
garbled
86a2448d10 Some powerpc cleanup. Remove unneeded/bad usage of extern oeacpufeat.
Convert asm code to use %r register format.  Done by comparison to
disassembled output, double checked with diff of dissasembled output
before and after, and test booted on my 7044.
2008-02-14 19:41:54 +00:00
matt
a54b0d709b Add multiple inclusion protection.
add oeacpufeat.
2008-02-14 05:35:36 +00:00
garbled
55804a6f72 Use model_init to clean up how we decide the ranges for
PCI_NETBSD_CONFIGURE.  Add some code to hopefully better handle the
firepower and powerstackII, based on the OFW dumps from those machines.
Untested on those machines, but doesn't break anything on pegasos/7044.
2008-02-11 17:32:18 +00:00
garbled
5532ebb058 Code to disable BAT use on cpu's that either don't have BAT's, or don't
gain any benefit from them.  This nets a small speedup on the POWER3, and
is probably needed for POWER5, which might not emulate BATs like the 3 does.
Also, thanks to Matt Thomas, who suggested re-using alitrap rather than
writing a new dsinobattrap that would have looked remarkably identical
when finished.
2008-02-07 03:20:16 +00:00
matt
809c851d23 Cleanup a few 601 ifdefs. 2008-02-07 01:17:51 +00:00
matt
48751dd9ca narg -> sy_narg 2008-02-07 01:16:21 +00:00
matt
e4dab59acd Cleanup/simplify #if/#endif 2008-02-07 00:36:57 +00:00
dsl
c2a8c787c3 Remove the 'args' parameter to 'trace_exit()' it is no longer used.
Instead of passing the (un)real system call code and syscall table pointer,
just pass the number of arguments - which is what ktrace really wants.
Ride forthcoming 4.99.53
2008-02-06 22:12:39 +00:00
garbled
ab2c4dad31 Some minor cleanup in the PPC_OEA601 code, and a fix for bridge-mode
cpus, which apparently still need the non-601 code to zap various
instructions into nops.
2008-02-06 03:15:06 +00:00
garbled
81953d91fb Ifdef out all the MPC601 code with PPC_OEA601. Now only arches that have the
possibility of running on an MPC601, are infected with all the extra code
and nops that it added.

Also, fix compilation that I broke with the pmap code, by adding
oeacpufeat to the locores of various ppc arches.  Noted by mlelstv.
2008-02-05 22:31:48 +00:00
mlelstv
54cb18b2a9 fix and cleanup debug printf formats 2008-02-05 22:15:30 +00:00
garbled
2234198b7f Replace as much of the hardcoded CACHELINESIZE with
curcpu()->ci_ci.dcache_line_size as I can.  With this change, an ofppc kernel
compiled with both PPC_OEA and PPC_OEA64_BRIDGE defined, boots.
2008-02-05 18:52:55 +00:00
garbled
4b513a9954 Rewrite a big chunk of the pmap and locore code for powerpc to better
deal with the 64bit bridge mode.  pmap changes by Matt Thomas, rest by myself.

Change pmap.c to work similar to exec_elf.c to allow us to compile in
multiple pmaps to a single kernel.  This allows the pmap for bridge64 to
co-exist with the 32bit pmap.

Yank __HAVE_PMAP_PHYSSEG from all the oea code.

Add a new global, "oeacpufeat", which is used early in locore to determine
certain cpu features.  This allows us to conditionalize code early in the boot
for certain CPUs that have special needs.

Yank most of the ifdef PPC_OEA_BRIDGE64 code from almost every file it was
found in.  Some of it seemed incorrect, and my 7044 booted just fine
without it.  It would appear that the bridge cpus treat BAT instructions
as nops, so they seem to be safe.

In ofppc, check the oeacpufeat, and if we are on a 64bit proc, clear
MSR[SF], and ASR[V].

With all of these changes, a kernel with both PPC_OEA and PPC_OEA_BRIDGE64
will boot on the POWERIII-2 cpu.  However, it will not yet boot on a 32bit
cpu, because of CACHELINESIZE.  Work remains to be done there to fix that.
2008-02-05 18:10:46 +00:00
matt
43fc601301 Use uintN_t in comments (since that's what are really using) instead of
u_intN_t
2008-02-03 06:28:01 +00:00
matt
14d4b29491 Add register{32,64}_t 2008-01-31 05:30:00 +00:00
mrg
9e023272db initialise "paddr_t lastaddr" to 0 in the cases it is not otherwise
set.  previously, if the stack garbage happened to match the
"curaddr" in _bus_dmamap_load_buffer(), the wrong thing may have
happened.
2008-01-29 23:46:21 +00:00
garbled
9c0d5a87e0 Pull another instance of bridge mode avoiding the BATs.
Fix FIRMWORKSBUGS.  The #else on one of the ifdefs for it made it so that
it would never work on a machine that didn't need it.  This caused IBM
machines to be unable to talk to OFW if the option was enabled.  Replace
the #else with a branch and call it good.
2008-01-28 21:06:29 +00:00
garbled
7636840ee2 Apparently BRIDGE mode allows BAT registers, so re-enable that code.
Change the pegasos PCI_NETBSD_CONFIGURE arguments around to wire up mem
space into the correct area, and move the io regs a little to make it
work properly. Just avoid the secondary PCI entirely.
Change the list of things that we fiddle with in pci_conf_hook.  Map mem
on the fwohci, avoid display cards, avoid IO on the auvia.
Change some printf's to aprint_*
Yank a call to genppc_pci_indirect_make_tag and change it to the
bus-independant pci call instead. (in pci_conf_hook)
2008-01-28 18:24:21 +00:00