Commit Graph

1207 Commits

Author SHA1 Message Date
tacha
08adc832cf remove obsolete "pci_enumerate_bus" definition. 2004-08-02 18:07:40 +00:00
uebayasi
33d0780d08 Fix an apparent syntax error. 2004-08-02 13:30:08 +00:00
simonb
ed2e469e3d Remove some debug printf()s.
Reorder an evcnt_attach_static().
2004-07-31 13:28:53 +00:00
manu
66fc5fb621 Empty shell for Darwin audit API 2004-07-28 22:24:06 +00:00
manu
57ae178c88 Added a simple bigcopy, from Srinivasa Kanduru 2004-07-25 09:21:48 +00:00
manu
f6a07159af typo 2004-07-15 20:21:55 +00:00
manu
1e147c565c Remove an outdated comment. 2004-07-15 11:51:56 +00:00
manu
51267dac7d Correctly set MSR static user bits on thread creation, as the calling
process might not have done it. This fixes crashes on thread creation.
2004-07-14 19:58:51 +00:00
matt
635306e7ba Clear PSL_SE on a scheduler activation upcall. 2004-07-09 22:59:17 +00:00
matt
4f6490d718 Add some comments, clean things up so routines can be called from the
idle loop.
2004-07-09 22:00:46 +00:00
manu
99b82f59fb Fix semantic problems with commpage functions, by Wolfgang Solfrank 2004-07-08 13:24:39 +00:00
manu
0d64053852 I copy/pasted the copyright notice from another file but I forgot to
change the name of the contributor: Wasabi Systems did not contribute
that file.
2004-07-08 07:36:25 +00:00
christos
f68663bc91 kill duplicate code. 2004-07-07 22:02:12 +00:00
manu
9ff70d0082 Assembly versions of commpage functions for Powerpc, by Peter Grehan.
bigcopy is still missing
gettimeofday is implemented as a system call, whereas on Darwin, it reads
the data from the commpage (the kernel updates it).
2004-07-06 14:11:49 +00:00
pk
a7c40722d8 Call inittodr() from main(). Let file system code set the recorded `last
update' time (if any) through the new function setrootfstime().
2004-07-05 07:28:45 +00:00
manu
67cf1bc043 MacOS X.3 introduces a new sigreturn for PowerPC, with a usercontext
versionning argument. For now we only implement the X.2 flavor.
2004-07-04 21:03:55 +00:00
manu
7fef082024 Move all the MD bits of commpage to a new file.
Map the comm page as RW in kernel (we want to modify it but not to execute it),
and RX in userland (no need to modify it but we want to execute it
2004-07-03 22:17:18 +00:00
manu
26200ee754 In MacOS X.3, the kernel maps tw opages of memory in every user process.
This areas is called the comm pages. It is used to provide fast access to
several data and functions.

The comm pages are mapped starting at 0xffff800 (address chosed so that
absolute branch can be used, so it can be accessed even when dynamic linking
is not ready). NetBSD has the user stack here, so we need to provide a
Darwin-specific stack setup routine which sets the top of the stack at
0xbfff0000.

This implementation is not complete but it does enough to get MacOS X.3
starting again (static binaries run, dynamic binaries still have an issue).
in the comm pages functions, we only implement bcopy, pthread_self and
memcpy.

TODO:
- clean up the powerpc specific code from MD parts
- for now we map only one page to avoid a crash, we want two pages.
- write all the comm functions.
2004-07-03 00:14:30 +00:00
kleink
0fea7f39a2 On OEA, turn PSL_USER* into runtime values appropriate for the CPU model
we're executing on; besides dealing with the bits not implemented in the
601's MSR it also removes the silent failure behaviour when passing
PSL_VEC set on a CPU not implementing it.

Also, fix those masks for the 4xx again.
2004-06-26 21:48:30 +00:00
kleink
5b37ad104f Repair a sentence. 2004-06-26 16:04:55 +00:00
kleink
0edffeb867 On MPC601s, rewrite any (unimplemented) tlbsync instruction as a sync. 2004-06-23 22:04:44 +00:00
kleink
8a98994beb Get rid of the silly CPU601 hooks and move BAT register restoration and
obliteration to RESTORE_{KERN,USER}_SRS, respectively; have oea_init()
patch these sequences to be skipped on non-MPC601s.  The code sequence
matching heuristic isn't as pretty as the one for VRSAVE and MQ but works
well enough with the current structure of the trap code, and can be easily
updated when necessary.
2004-06-09 23:24:51 +00:00
kleink
15764c5ab2 pmap_extract(): consider the MPC601's different battable layout, and its
use of I/O segments.
2004-06-09 19:30:57 +00:00
kleink
00fcabcfc9 Print SPR 0x100 as VRSAVE on non-4xx. 2004-06-09 19:19:05 +00:00
kleink
b7ca652249 Add MPC601 support. 2004-06-08 19:29:53 +00:00
kleink
1e669a49c6 Repair a comment misplaced in rev. 1.43. 2004-06-08 19:07:00 +00:00
kleink
d92e6963e4 Add some BAT-style predicate macros. 2004-06-06 21:23:53 +00:00
kleink
7498ed2ff7 Mark cr0 as clobbered in mfrtc(). 2004-06-06 10:45:06 +00:00
thorpej
e33c2bb5d5 Add the %MAKEOPTIONSAPPEND token at the end of the file, after the
common Makefile.kern.inc has been included.
2004-06-04 04:45:49 +00:00
matt
3c0ef6aa5f Fix softnet intr handling (to be like the generic ppc softintr). 2004-06-01 00:49:41 +00:00
kleink
7b3b647647 Factor out W{CHAR,INT}_{MAX,MIN} into their own header file. 2004-05-08 21:51:47 +00:00
matt
886b18bf35 Add PT_MACHDEP_STRINGS so that kdump(1) can print out the PowerPC-specific
ptrace requests.
2004-05-06 22:53:02 +00:00
kleink
0e5d242328 Update for new pci_devinfo(9) signature. 2004-04-24 15:49:00 +00:00
matt
e3aa635a37 Fix tpyo. 2004-04-18 23:32:46 +00:00
matt
0f0d66d66e Add entry for netns/ns_cksum.c 2004-04-18 23:31:45 +00:00
matt
8cd24529dc Add a SAVE/DISCARD flag to save_{fpu,vec}_lwp. Use it appropriately.
Nuke struct fpu and use struct fpreg instead (except for the names, they
were identical).  On MP machines, this will avoid an unneeded IPI to save
the register contents that are about to discarded.
2004-04-16 23:58:08 +00:00
hannken
3dc578de5e Make it compile when PPC_HAVE_FPU is not defined. 2004-04-16 08:52:41 +00:00
matt
ee00feaab9 Revamp how user MSR/SRR1 are dealt with.
Add a PSL_USEROK_P(psl) macro which valids the bits (replaces the use of
PSL_USERSTATIC).
Add a PSL_USERSRR1 mask which is used to mask out status bits in the upper
half of SRR1.
Make sure PSL_VEC is set appropriately in userret().  PSL_VEC is in the same
region as SSR1 status bits so it's not preserved on exceptions.  Thus we
need to make to set it.
When returning a MSR/SRR1 to userland, always clear the status bits.
Add emulation of the mfpvr, mtmsr, and mfmsr instructions.
2004-04-15 21:07:06 +00:00
matt
949694f7d9 When seeing if the FP or VEC unit has been stolen by another process, check
PSL_{FP|VEC} instead of PCB_{FP|VEC}.  The former will only be set if the
process owned the {FP,VEC} unit when it trapped into the kernel.  The latter
would be set if the lwp ever used the {FP,VEC} unit.
2004-04-06 02:25:22 +00:00
simonb
3ce5632009 Fix tyop. 2004-04-05 04:53:01 +00:00
matt
15fc41dbb0 When trying to figure out which code to return, use the exception enable
bits to mask out the undesired exceptions.  (Thanks to Todd Whitesel for
the idea).
2004-04-04 22:20:44 +00:00
matt
e7c76e51e6 Add SIGFPE handling code. Report the proper SIGINFO ksi_code when a SIGFPE
happens.  When a SIGFPE occurs, disable the exception enables in the FPSCR.
2004-04-04 19:21:36 +00:00
matt
bc8d283982 Reformat the __asm a bit. 2004-04-04 17:35:15 +00:00
matt
5bf797c2e1 Add int get_fpu_fault_code(void). 2004-04-04 17:26:58 +00:00
matt
481d181cd4 In cpu_getmcontext, make sure the returned MSR has the FP exception mode
(PSL_FE0|PSL_FE1) saved in the PSL.  In cpu_setmcontext, copy the FP
exception bits to the PCB where they live.
2004-04-04 17:26:10 +00:00
matt
847bed9428 Fix the way cpu_setmcontext was restoring FPSCR. Make the opposite of the
way that cpu_getmcontext was saving it.  (FPSCR was being saved incorrectly
before and thus obliterated when a signal happened).
2004-04-04 17:20:15 +00:00
matt
7681ce429d Make sure that the SRR1 we pass to userland reflects PSL_FE0|PSL_FE1 even
if the lwp doesn't currently own the FPU.  When returning, copy those bits
back to the PCB.  (In case the user decided to the FP exception mode in the
signal handler).
2004-04-04 17:10:32 +00:00
matt
4dc0aa3dee Don't add PSL_FE_FDLT to srr1, but put in pcb_flags. It will be added to
the SRR1 only when the lwp owns the FPU.
2004-04-04 17:05:31 +00:00
matt
44003b5fca The FP exception mode bits from the MSR will be stored in pcb_flags. From
there, they will copied to MSR as needed (when FP is enabled).  They will be
cleared from the MSR when the lwp loses the FPU.  Hence they need to be stored
someplace else.
2004-04-04 17:01:44 +00:00
matt
aed3d18029 On FPU'ed systems, initialize the default FP exception mode. 2004-04-04 16:57:00 +00:00