Commit Graph

1116 Commits

Author SHA1 Message Date
matt
7ad3fe6e03 When mapping a page with BUS_SPACE_NOCACHE, make sure to flush the
physical page from the data cache.
2003-03-15 07:25:20 +00:00
matt
35962f72c9 s;backside;; and report L2CR_L2DO & L2CR_L2IO 2003-03-15 07:22:46 +00:00
matt
2b8417e488 Add LINTSTUBs and make oea_init() agree with them. 2003-03-15 07:21:02 +00:00
matt
df24bda908 Make lint happy. 2003-03-15 07:19:20 +00:00
matt
d03db36449 Use aprint_normal. Print 2MB L2 sizes with 7410. 2003-03-14 06:27:40 +00:00
matt
e0242aaebc Remove Debugger call. 2003-03-14 06:25:58 +00:00
matt
d50c91e021 Make lint happy by not assigning to casted lvalue. 2003-03-14 06:23:48 +00:00
matt
12dca1407b Condition ({ ... }) by __GNUC__. Remove redundant SPR_IBAT0U definiton. 2003-03-14 06:22:51 +00:00
matt
d7fc76efe1 Add _LOCORE protection. 2003-03-14 06:21:19 +00:00
matt
61920c743e Make ALI trap print DSISR. 2003-03-14 05:38:53 +00:00
matt
a7b613e469 Use __asm and __volatile to make lint happy. 2003-03-14 05:37:51 +00:00
matt
ce05df7bc7 Quiet lint warning. 2003-03-14 05:37:14 +00:00
matt
8ceb32c0af make LINTSTUB work with this. 2003-03-14 05:36:39 +00:00
matt
c894ddaec1 Print more useful messages on kernel ALI or PGM traps. 2003-03-14 05:32:27 +00:00
matt
0c29e154e3 Use __asm & __volatile to make lint(1) happy. 2003-03-13 17:30:38 +00:00
matt
cd26de2684 Same code exists in both halves in #ifdef/#else/#endif. move it outside. 2003-03-12 06:00:36 +00:00
hannken
44b1e07ec9 Add support for the IBM 403GCX cpu. Enabled with "options PPC_IBM403".
- different set of device control registers.
  - non-standard access to the time base.
  - 16 byte cache lines.

Approved by: Eduardo Horvath <eeh@netbsd.org>
2003-03-11 10:40:15 +00:00
matt
210f48e582 Remove unneeded conditional code. 2003-03-06 07:15:46 +00:00
matt
0b8a5fd80f Adapt to powerpc/bus.h changes. 2003-03-06 00:20:39 +00:00
matt
ff2281b498 Add preliminary support Marvell (Galileo) Discovery System Controllers.
This code was contributed by Allegro Networks.
2003-03-05 22:08:18 +00:00
matt
6d251b3be3 Make AltiVec registers available via ptrace/procfs. Simplify AltiVec
processing.  Add a "common" procfs_machdep.c for PowerPC platforms.
Even though it is supposed to be port specific, most (if not all)
PowerPC ports can just use the common one.
2003-03-05 05:27:24 +00:00
matt
fb2cebb577 Pass the address of the intrframe to the ext_intr routine. 2003-03-04 08:34:12 +00:00
matt
107803a3a3 Re-arrange things in evbppc & powerpc to support OEA-based eval boards
in evbppc.  OEA-based board(s) to be added later.
2003-03-04 07:50:57 +00:00
matt
9875f9218d Add some missing volatiles. 2003-03-04 07:48:09 +00:00
tshiozak
31e2cbf0b5 add some ISO C 1995 I18N functions and types:
btowc, wctrans, towctrans, wcscoll, wcsxfrm, wctype_t and wctrans_t.
2003-03-02 22:18:11 +00:00
matt
5401f85320 Restore MQ to trapframe from mcontext since it's in both. 2003-03-02 01:07:55 +00:00
jklos
b9f3bdb8fb Added L3CR_CONFIG to the parameter list for 745x L3 cache configuration. 2003-02-26 21:14:32 +00:00
jklos
0c5117e1f9 Added configuration entries for L3CR_CONFIG for L3 caches on 745x
accelerators. Thanks to Monroe Williams.
2003-02-26 21:10:51 +00:00
jklos
7109206620 Added L3CR_CONFIG for support of 745x G4 L3 cache configuration. 2003-02-26 21:05:23 +00:00
matt
869bbf806d Add some RAS support. Don't print out a message when we encounter
trap instructions.
2003-02-25 23:32:03 +00:00
matt
8609ed56b8 Only define KERN_AS= object if IDENT has -DLKM. 2003-02-24 07:15:40 +00:00
atatat
860ed88533 #include opt_uvm.h in machine/vmparam.h (for those ports offering the
topdown option) so that including it directly before including
uvm/uvm_param.h (or uvm/uvm_extern.h which includes uvm/uvm_param.h)
and attempting to use topdown won't result in a compiler error.

Problem noted in private email.
2003-02-23 19:13:43 +00:00
matt
b03aef6efc witch from xor r,r,r to li r,0 to set a register to 0. It's clearer (and
better for G4 processors).
2003-02-21 15:14:08 +00:00
matt
c1234c6385 Add TOPDOWN VM support. 2003-02-21 03:41:52 +00:00
matt
b42cde14b7 Set KERN_AS=obj now that LKMs work. (otherwise when you loaded LKMs they
wouldn't have all the library routines available).
2003-02-19 23:55:48 +00:00
matt
5bcfb63de7 Add PSL_PM 2003-02-14 04:45:32 +00:00
matt
8268fcff94 Use register 8, not 0, when construct OF_buffer address. 2003-02-13 15:02:49 +00:00
manu
06def0e4fb Build again 2003-02-10 21:46:49 +00:00
matt
f6201cca8d Only include kernel headers if _KERNEL is defined. 2003-02-10 04:01:37 +00:00
matt
47afa5aa99 Don't try to reserve DEAD zone unless the kernel address space encompasses it. 2003-02-08 20:42:07 +00:00
matt
4fefe75ac1 Add comments to describe PowerPC64 ABI register usage. 2003-02-08 20:03:22 +00:00
thorpej
6068b273f4 Fix some printf formats. 2003-02-07 04:39:09 +00:00
matt
48e8876d50 Add a _bus_dmamap_sync which supports cache-incoherent implementations.
Support BUS_DMA_NOCACHE.
2003-02-06 23:03:54 +00:00
matt
5d223c9c9c Add oea_iobat_remove(paddr_t). 2003-02-06 23:02:33 +00:00
matt
42b98bbd45 Allow KERNEL_SR/KERNEL2_SR to be overriden (I run a kernel with
the mapped space at 0x8000000-0x9fffffff).
2003-02-06 23:01:32 +00:00
matt
c766d3b064 Include vmparam.h to get USER_SR. 2003-02-06 23:00:15 +00:00
nakayama
e3e4805068 Replace machine/rnd.h with more appropriate name to share it
with cycle counter based microtime in kern/kern_microtime.c.
2003-02-05 13:57:50 +00:00
matt
cc7308ce0b Make _LP64 friendly. 2003-02-05 07:35:31 +00:00
matt
a835619dbe Needed for compat_netbsd32. 2003-02-05 07:16:49 +00:00
matt
6522fb435a Make LP64 friendly. 2003-02-05 07:16:27 +00:00
matt
3cdbb8ccfe Make things a bit more LP64 friendly. 2003-02-05 07:05:19 +00:00
matt
37f4a39d7e Don't define pmap_t if _LOCORE is defined. 2003-02-05 01:27:34 +00:00
matt
52263a8c80 LKM's need a pmap_t typedef but there's no PPC_xxx to defined which pmap.h
to include.  So just declare the pmap_t and don't do anything else.
2003-02-04 01:31:49 +00:00
matt
b4450c6d3c Move ibm4xx vmparam.h to powerpc/include/ibm4xx directory. Add a stub
vmparam.h to choose the right vmparam.  This is needed so evbppc can host
both ibm4xx and oea based eval boards.
2003-02-03 23:09:29 +00:00
matt
a25898cf6e Don't use trapframe in sigcontext. Instead define a new structure
utrapframe that fixed in size (and the same size as the trapframe
in NetBSD 1.5).  This preserves binary compatibility for those programs
that dealt looked at sigcontexts.
2003-02-03 21:48:01 +00:00
matt
2b0e97a561 Rename PPC_MPC6XX to PPC_OEA (and any mpc6xx reference to oea). 2003-02-03 17:09:53 +00:00
matt
3e793a03a1 More cleanup for OLDPMAP. 2003-02-03 05:15:51 +00:00
matt
193a5761aa Remove OLDPMAP support. 2003-02-02 21:22:11 +00:00
matt
f38c95025b This file is no longer needed. 2003-02-02 20:47:38 +00:00
matt
7c1e50a21a Perform a rototill of the powerpc code. Mandate use of SPRG0 to store
a pointer to current cpu's cpu_info structure.  Use cpu_info for
intstk,intr_depth,still_stk,idle_pcb,curpcb,curlwp,etal even on
non-MULTIPROCESSOR machines.  Add common macros GET_CPUINFO and
INIT_CPUINFO to get and initialize the cpu_info struct on startup.  Make
ibm4xx use the standard <powerpc/frame.h>.  Use IFRAME_xx in ibm4xx
trap_subr.S instead of explicit magic offsets.  Move INTSTK and SPILLSTK
to std.<platform>.  Change faultbuf to a struct instead of an array.

On MPC6XX cpus, stop using the vector page for temporary space and use
reserved space in cpu_info.
2003-02-02 20:43:17 +00:00
kent
cd7d9faeaf Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it. 2003-01-28 01:07:51 +00:00
manu
55215e5266 Remove right duplication on thread creation, which became useless now we
are using lwp.
Enable kill -9 to kill parent thread waiting for its child.
Use upcallret instead of child_return for the newly created lwp.
Add debug messages for thread creation.

Thread creation are still broken...
2003-01-26 12:39:32 +00:00
manu
cb771e3c64 Make the beast build again (but it is still probably broken) 2003-01-24 21:37:01 +00:00
kleink
87f0398e29 Fix inverted test in previous. (D'oh!) 2003-01-24 21:26:08 +00:00
kleink
15027ca61b Correct inverted logic in comment. 2003-01-23 15:59:38 +00:00
kleink
2332bdc2f1 Sync MPC601 support bits with UP version. 2003-01-22 22:20:23 +00:00
kleink
6bc656a38f Whitespace nit in previous. 2003-01-22 22:15:06 +00:00
kleink
8065f1dfa1 MPC601 support bits:
* install 601-specific DSI and RUNMODETRC trap handlers
* save/restore MQ in trapframe, add MQ hooks to DDB
* extend battable to 512 entries to hold the 601's 8M translations
* instead of adding I/O to BAT starvation, set up segment registers
  for Memory-Forced I/O Controller Interface Access
* sync after tlbie
2003-01-22 21:44:54 +00:00
kleink
892f5b1680 Add mfrtcl() and mfrtc(), similar to mftbl() and mftb(). 2003-01-22 21:05:50 +00:00
kleink
7553f82ab0 Recognize %mq, and adjust disasm_fields() slightly to print it. 2003-01-22 21:03:37 +00:00
matt
b03d17694a Do a preliminary switchover of the mach code to lwp's. It compiles now
but probably doesn't work.   That's for someone who understand this code
better.
2003-01-21 04:06:06 +00:00
matt
82fd269f15 __greg_t should be an long, not int. (LP64 friendliness) 2003-01-20 06:58:10 +00:00
matt
2f3596224d Kill all references to struct __gregs and use the _REG_xx names. 2003-01-20 05:26:46 +00:00
matt
fb891b41f5 Add _REG_foo to ppc mcontext and use them instead of constants. 2003-01-20 00:53:55 +00:00
matt
5fac7ff5ae Make this reflect reality. 2003-01-19 09:23:39 +00:00
matt
a0356cae2a Add CALLFRAMELEN and use it. 2003-01-19 02:47:36 +00:00
matt
ef4a3f75d9 LP64'ify. 2003-01-19 02:46:08 +00:00
matt
f35338749b Cast to register_t instead of int to be nicer for LP64.
Simplify copyin/copyout/copyinstr/copyoutstr.  Fix bug
where the user virtual address was not updated so that
if the user's buffer crossed a segment boundary, the
wrong data could be copied.  Localize USER_SR to the
ILP32 version of setusr/unsetusr.
2003-01-19 02:43:11 +00:00
matt
d8f30693f8 Use CALLFRAMELEN instead of 16. 2003-01-19 02:39:47 +00:00
matt
bf7778a6da Add trapframe32 (for compat_netbsd32).
Add CALLFRAMELEN.  (so we can remove many of the hard coded "16" or "15"
in the powerpc code).
2003-01-19 00:42:24 +00:00
matt
328674047a ALIGN should use u_long, not u_int 2003-01-19 00:25:22 +00:00
matt
92609b9678 Cast to register_t, not int, to be more LP64 friendly. 2003-01-19 00:01:09 +00:00
matt
b3d36290af Improve sigcode.S template so linux_sigcode.S can use it as well. Add a
netbsd32_sigcode.S.
2003-01-19 00:00:11 +00:00
matt
d192a5d694 Cast to register_t, not int, to be more _LP64 friendly. 2003-01-18 23:58:19 +00:00
matt
e20e04fa05 Allow other compat use this as a template. 2003-01-18 23:46:32 +00:00
matt
4adb810fe1 In cpu_upcall, cast to register_t, not int. (int is not LP64 friendly) 2003-01-18 23:43:24 +00:00
matt
b7af0cbc04 Add LP64 support. 2003-01-18 21:38:03 +00:00
matt
024c9c135c Add a temporary bridge to use %foo regnames in kernel / standalone code. 2003-01-18 21:36:44 +00:00
matt
3d62e5c159 Fix LP64 botch. 2003-01-18 21:32:58 +00:00
matt
d610b65d22 Make register_t. Change the printfs in trap.c to match. 2003-01-18 21:28:10 +00:00
thorpej
f91b0bb3f2 Merge the nathanw_sa branch. 2003-01-18 06:23:28 +00:00
matt
0ccdd339c8 A small LP64 fix. 2003-01-16 09:17:01 +00:00
augustss
cb7fde57d3 Make it compile on MPC6xx. I'm not sure about MPC40x. 2003-01-13 20:29:34 +00:00
simonb
61593bd957 Fix a tyop and some grammar. 2003-01-08 00:41:41 +00:00
wiz
1035faff1d writable, not writeable. 2003-01-06 20:30:28 +00:00
thorpej
1106d42424 On the IBM 4xx, don't enter DDB on user mode traps. Fixes
port-powerpc/19662.

Some minor cleanup while here.
2003-01-04 23:46:11 +00:00
thorpej
62a4b10f83 Make this compile without DDB. 2003-01-04 18:04:43 +00:00
augustss
a89cd41b68 Add NEED_SYMTAB to run dbsym. 2003-01-01 16:14:36 +00:00
thorpej
95fa2e148a Use aprint_normal() for cfprint routines. 2003-01-01 01:57:51 +00:00
manu
f464631d66 Several things:
1) rights should be shared by the threads within a process. While it would
be easier to handle this with the struct proc/struct lwp split, we attempt to
do this now by sharing the right lists. Because each right holds a reference
to struct proc, this might cause some problems later.
2) in pthread_exit, really exit the thread. Also reintialize the righ tlist to
make sure we will not destroy the parent's right list
3) rights can hold multiple permissions on a port (ie: send and receive). Fix th
is.
4) first attempt on right carried by messages. We still have to do rights carrie
d in the message body (complex messages).
2002-12-27 09:59:24 +00:00
manu
4a06119a9d Pass the system call table to trace_enter() and ktrsys() so that it is
possible to use alternate system call tables. This is usefull for
displaying correctly the arguments in Mach binaries traces.

If NULL is given, then the regular systam call table for the process is used.
2002-12-21 16:23:56 +00:00
scw
4e87eae834 Use Software Single Stepping for now when PPC_IBM4xx is defined. The
existing hardware assisted method doesn't work on this cpu.

Also correct the "I_B" constant in db_machine.h.
2002-12-20 15:23:12 +00:00
thorpej
2a39e8388d Merge the IBM 4xx into the common powerpc/locore_subr.S, and
eliminate all the duplicated context switch related code in
the IBM 4xx port.
2002-12-19 19:37:25 +00:00
thorpej
a6dc36fa4e Build LKMs with -msoft-float. 2002-12-19 19:36:26 +00:00
scw
c10c20ac28 Add a range check for the DCR address in db_ppc4xx_dcr(). 2002-12-19 13:45:03 +00:00
scw
de98ba0a49 Add a "machine dcr" command, for the IBM4XX case, which permits
reading/writing of the cpu's DCR registers.
2002-12-19 13:29:53 +00:00
manu
98bc8767ae Bug fixes:
- In case of ailure in the child, kill the child and wakeup the parent
- Do call child_return
- The src and dst args were mixed up when copying regs 0-31 to the trapframe

This makes pthread_create(3) fully working (test program works).
2002-12-12 08:23:27 +00:00
manu
66a29c52af Added a few Mach traps: mach_boostrap_register, mach_port_set_attributes,
mach_port_move_member, mach_port_set_attributes, mach_task_set_special_port,
(none do anything)
Added mach_thread_create_running, which creates a new Mach thread. It
provides the register context of the new thread. We use it in a child
function provided to fork1(). The child function is machine dependent and
is not yet implemented for i386.

The new thread crashes quickly, but at least it starts.
2002-12-12 00:29:23 +00:00
thorpej
e8cc3884de Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is. 2002-12-10 17:14:02 +00:00
thorpej
78ea2dd367 Use __LDPGSZ (which must be == USRTEXT) as the text address for a.out
executables, and eliminate the USRTEXT constant, which was only used
by the a.out exec code.
2002-12-10 05:14:24 +00:00
scw
67d6f49379 Changes/additions to support evbppc. 2002-12-09 12:28:12 +00:00
manu
9f6565f2bd A working fork/vfork implementation. Darwin fork differs from our fork by
two ways:
- the child gets its pid as retval[0] (userland stub will turn it into a 0),
retval[1] is 1 and it is 0 in the parent.
- in the child, the fork syscall is successful, hence we must skip the next
instruction.
2002-12-08 21:53:10 +00:00
manu
3b0f6d78ed Introduce BSD system calls with alternate patch checking (in /emul) in
compat/common, so that they can be shared by several emulations, and use
them for Darwin.

This removes the ugly dependance on FreeBSD freebsd_file.c for COMPAT_DARWIN
2002-12-08 00:50:23 +00:00
thorpej
a13469e728 Revert my previous GCC 3.3-related changes; GCC 3.3 has been fixed
to handle our stdarg/varargs ABI for PowerPC.
2002-12-04 17:42:51 +00:00
manu
a9a3da8aca The recent mach trap support caused indirect system calls (a la syscall(2))
to be incorectly recorded as 'syscall'. Fix this.
2002-11-29 11:56:36 +00:00
manu
508a5615a6 Build the beast again after siginfo changes 2002-11-29 00:04:03 +00:00
manu
dfa96ff4b3 Add signal delivery for the PowerPC. Everything is implemented except siginfo.
The stack layout is observed from stack dumps on Darwin, so it should be
very accurate.
2002-11-26 23:54:09 +00:00
manu
edff1c8d0a There is too much debugging, it's getting annoying. Let's remove some. 2002-11-26 23:48:44 +00:00
lukem
0635de35a3 Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more. 2002-11-26 23:30:07 +00:00
manu
53356d6169 Added an empty shell for signal delivery. Now we just have to fill the
machine dependant bits.
2002-11-25 22:25:12 +00:00
thorpej
b65c7c5437 Avoid strict-alias warnings. 2002-11-25 05:37:00 +00:00
thorpej
2e9c89031c Statements after labels. 2002-11-25 05:11:32 +00:00
thorpej
35a57313da Use tlbrelo and tlbrehi. 2002-11-25 05:10:39 +00:00
thorpej
54dbc0eab3 Avoid strict-alias warnings. 2002-11-25 02:46:10 +00:00
thorpej
113c35cbf2 Remove an unnecessary token-paste, as pointed out by GCC 3.3. 2002-11-25 02:45:46 +00:00
thorpej
3151023170 Remove redundant (and incorrect) extern decl. 2002-11-25 02:07:37 +00:00
thorpej
796aa6a84a Statements after labels. 2002-11-25 02:06:16 +00:00
thorpej
3911a545e1 No newlines in string constants. 2002-11-25 01:36:35 +00:00
thorpej
6fd88f0e65 Avoid a trigraph. 2002-11-25 01:33:51 +00:00
thorpej
11707809eb No newlines in string constants. 2002-11-25 01:31:12 +00:00
thorpej
0eb35ef834 Instrument FP emulation traps. 2002-11-24 17:34:06 +00:00
thorpej
baf5c58201 Use EVCNT_TYPE_TRAP. 2002-11-24 17:05:45 +00:00
thorpej
02c69e5261 Put interface attributes on the device, not another attribute with
the same name as the device.
2002-11-23 19:42:41 +00:00
manu
c6cc98345b Correctly report the CPU type in Mach host_info(BASIC_INFO) 2002-11-17 01:24:03 +00:00
manu
93df539f73 As we use one FreeBSD file for COMPAT_DARWIN, we must include file.freebsd 2002-11-17 00:59:13 +00:00
manu
a26a564e59 Implment map_fd mach trap
Fix host_info(BASIC_INFO) which was broken wrt to the number of field
returned.
2002-11-16 20:00:29 +00:00
manu
e7cfdc3995 Darwin skips the next instruction after a successful system call. Strange
world.
2002-11-15 23:19:22 +00:00
manu
3fc8f36b8d Make it build again 2002-11-15 21:48:06 +00:00
manu
d584ed9598 Add a realcode argument to trace_enter and ktrsyscall. realcode is the
original system call number, which can be negative for a Mach trap.
We cannot just replace code by realcode, because ktrsyscall uses it as
an index in the system call table, thus crashing the kernel when the
value is negative.
2002-11-15 20:06:00 +00:00
christos
1a546a91c0 get the cpu basic info. 2002-11-14 19:44:36 +00:00
matt
da584e2f99 If MULTIPROCESSOR, just accept the penalties of doing BAT flipping when
syncing the icache.
2002-11-13 21:08:50 +00:00
matt
3a5d673363 Change syscall to bound code so that systrace and ktrace won't fall off
the end of a table.   XXX this is wrong since code does not indicate the
sysent table for which code was used as an index.
2002-11-13 09:36:10 +00:00
matt
9cf475322b Do kernel non-USER_SR pte spilling regardless of interrupt count. Only do
kernel USER_SR spillage if interrupt depth is 0.
2002-11-13 09:33:20 +00:00
manu
530968e795 The kernel now builds with COMPAT_DARWIN. 2002-11-12 23:40:19 +00:00
jdolecek
2ba45545df back previous off; don't install macho_machdep.h 2002-11-04 15:27:15 +00:00
matt
85529376d3 Get rid of nsysent. Use EMULNAMEU to use the appropriate constant.
Revamp the mach_syscall_dispatch function to be much simplier (pass in
a syscall code and return a const struct sysent * pointer).
2002-11-04 00:01:02 +00:00
manu
873ed6f9ee Added support for Darwin's PowerPC-only system calls:
ppccalls, with system call numbers starting at 0x6000
fasttraps, with system call numbers starting at 0x7FF0

Because the Mach system call dispatching code has grown a bit
too much, introduce an inline function to handle it (mach_syscall_dispatch).

While we are there, remove the Mach and Linux includes from
arch/powerpc/powerpc/syscall.c and push them into
arch/powerpc/powerpc/{mach|linux}_syscall.c
2002-11-03 23:17:18 +00:00
matt
6d54e503b3 LP64 changes (copied from mips and changed CHAR_MIN/MAX to 0/0xffU). 2002-11-03 22:55:24 +00:00
matt
c89494d09b Change _MACHINE_foo_H_ to _POWERPC_foo_H_ 2002-11-03 22:36:22 +00:00
matt
6dc0eb390f Add LP64 bits (copied from MIPS). 2002-11-03 22:35:33 +00:00
matt
0d380378cf Add LP64 limits. 2002-11-03 22:23:59 +00:00
jdolecek
80f0f798bc back previous revision 1.9 off - compat code was changed to set
struct emul e_nsysent to *SYS_NSYSENT now, and the mask is more efficient
2002-11-02 07:37:33 +00:00
matt
71416f6690 In struct emul, e_nsysent is *not* initialized to *SYS_NSYSENT but
*SYS_MAXSYSCALL.  Adjust to this and simply compare 'code' to it instead
of doing the p-o-2 dance.
2002-11-01 00:02:40 +00:00
matt
1cec255a41 Move child_return back to syscall.c
Fix syscall to use emulations SYS_syscall/SYS___syscall definitions.
Use the emulation NSYSENT to limit code.
Don't define *syscall_fancy if it will never be used.
2002-10-30 18:34:15 +00:00
manu
6224b0c0ce Fixed mistakes 2002-10-30 07:39:40 +00:00
manu
fddf44c0bf Add COMPAT_MACH and EXEC_MACHO support on the PowerPC 2002-10-30 06:41:45 +00:00
manu
a3da524774 Prepare syscall.c for COMPAT_MACH support. linux_syscall_intern is
moved to a Linux specific file, child_return is moved to trap.c,
and we introduce a EMULNAME macro co that syscall.c can be included to
define the system call handler for another emulation.
2002-10-30 06:37:37 +00:00
manu
fe4e91080d Moved binary compatibility options from arch directory to cpu directory 2002-10-30 06:26:42 +00:00
manu
f9cac3b168 Changed the ifndef guard of this header file from _MACH_EXEC_H_ to
_POWERPC_AOUT_EXEC_H_. The former was conflicting with
<compat/mach/mach_exec.h>.
2002-10-28 18:00:40 +00:00
thorpej
4b68c83f09 Make these work with GCC 3.x. 2002-10-25 20:46:44 +00:00
jdolecek
e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
chs
4017fd1809 fix two bugs in the previous PTE-spill handling changes:
- in pmap_pte_spill(), the victim PTE could be using the secondary hash,
   in which case its pvo entry is actually in the other bucket.  use the
   correct bucket for the victim pvo when moving it to the front of its list.
 - similarly, in pmap_pvo_remove(), if the pteidx is pre-computed for us,
   it might actually point to the other bucket if the entry is using the
   secondary hash.  adjust ptegidx if this is the case.

these should fix PRs 18645 and 18736.
while I'm here, wrap line lines and do some other misc cleanup.
2002-10-22 04:34:13 +00:00
nathanw
c1cc872908 Catch up some code inside #ifdef DEBUG to recent pvo_entry changes. 2002-10-18 20:02:23 +00:00
matt
69f28d5e54 Remove pmap_pte_spill calls. 2002-10-10 22:44:21 +00:00
matt
8c472e414b Move pte_spill calls from trap_subr to trap(). Count the number of
"evictions" and avoide calling pmap_pte_spill if there are no evictions
for the current pmap.  Make the ISI execption use the default exception
code.  Remove lots of dead stuff from trap_subr.

Make olink use TAILQ instead of LIST and be sorted with evicted entries
first and resident entries last.  Make use of this knowledge to make
pmap_pte_spill do a fast exit.
2002-10-10 22:37:50 +00:00
jdolecek
3aa30dca1a fix typo - driver name is 'opb', not 'obp' 2002-10-10 13:45:14 +00:00
thorpej
89bf5a8f8e Add trailing ; to CFATTACH_DECL. 2002-10-02 15:52:22 +00:00
thorpej
b96bc0d7bc Use CFATTACH_DECL(). 2002-10-02 04:06:36 +00:00
thorpej
d652bdcafe Use CFATTACH_DECL(). 2002-10-01 02:49:56 +00:00
thorpej
f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
provos
0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
thorpej
6c88de3b53 Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.
2002-09-27 03:17:40 +00:00
thorpej
d1ad2ac4f2 Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver.  The cfdriver is then looked
up in a list which is built at run-time.
2002-09-27 02:24:06 +00:00
matt
b6b04cb00c In mftb(), make sure we say we are clobbering cr0. 2002-09-26 01:13:32 +00:00
thorpej
71404bb533 Don't include <sys/map.h>. 2002-09-25 22:21:01 +00:00
simonb
63096043b3 Use "#define\t" instead of "#define ". 2002-09-22 08:30:56 +00:00
chs
c081614ea2 it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not.  doh.
2002-09-22 07:53:39 +00:00
chs
55e1f79335 add pmap_remove_all() hook (empty on most platforms so far). 2002-09-22 07:17:08 +00:00
gmcgarry
dca80f08fd Add __HAVE_MD_RUNQUEUE flag for MD code to override MI run queue primitives. 2002-09-22 04:11:32 +00:00
chs
128b037bfc remove all vesitages of dk_establish(). 2002-09-18 01:46:23 +00:00
chs
5a93abd050 fix the FIRMWORKSBUGS case: ofwr_init() substitutes a wrapper OFW entry point
for the real one, so we must call it before we save off the entry point
that the higher level code will use.
2002-09-16 02:07:24 +00:00
matt
45e5f68016 Allow MAXPHYS to be overriden. Increase the default MSGBUFSIZE to 2 pages. 2002-09-06 19:26:26 +00:00
gehenna
77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
matt
05980fc1da Move bufpages to top of kernel vm space. allocate dead zone after buf
pages so that it go larger than > 256MB.
2002-08-28 06:27:20 +00:00
scw
5cff5c076e Don't need <machine/walnut.h> here. 2002-08-27 12:23:06 +00:00
thorpej
139cdc3125 Make nbuf, nswbuf, and bufpages unsigned. Make all operations on these
variables unsigned, and update places where their values are printed.
2002-08-25 20:21:33 +00:00
matt
ffdea2c266 Only do the dssall if cpu_altivec is set. 2002-08-23 16:08:10 +00:00
scw
5b79fdfaf7 Add "ecc at plb" device.
Add an "irq" locator to the plb device.
This gets rid of the original hack where ecc support was wedged into
the cpu driver.
2002-08-23 15:01:07 +00:00
simonb
3502025a54 Show the IRQ we attach the ECC handler to. 2002-08-23 13:43:18 +00:00
scw
9ba60b4297 Install the ECC error interrupt handler at the level specified by
a "4xx-ecc-irq" property.
If the property isn't defined, assume the hardware has no ECC support.
This should, ideally, be a config file option.
2002-08-23 12:46:49 +00:00
scw
c4fdfebd38 Allow port-specific Makefiles to override the name and location
of locore.[So].
This is in preparation for arch/evbppc.
2002-08-23 12:01:58 +00:00
scw
a0d58bf2f5 Remove an extra trailing bracket in a DEBUG printf. 2002-08-23 11:59:40 +00:00
scw
f384fe8ba7 Don't assume all com ports run at "COM_FREQ", or a multiple thereof.
Use a board-specific property instead.
2002-08-23 11:42:13 +00:00
scw
19c988633d Don't frob cpu-specific DCR registers in common code. 2002-08-23 11:40:07 +00:00
scw
4968573654 Split off common 4xx locore code so it can be re-used by other 4xx ports. 2002-08-23 11:37:53 +00:00
matt
510b31be28 Add missing PMAPCOUNT2 macro for the non-PMAPCOUNTERS case 2002-08-22 15:43:08 +00:00
matt
9e33535006 Add more evcnt entries for monitoring the page table entries. 2002-08-21 18:36:55 +00:00
matt
c7a899fa13 Use "b" constraint for base registers (indexed addressing mode). 2002-08-20 06:04:38 +00:00
matt
8a75cdd09b Add evcnt's for common pmap activities when PMAPCOUNTERS is defined
in the config file.
2002-08-18 19:18:33 +00:00
matt
5ba45ecc9c defflag PMAPDEBUG, PMAPCHECK, and PMAPCOUNTERS into opt_pmap.h 2002-08-18 17:17:59 +00:00
matt
d2965f3ad3 Prepare for PPC64. Use register_t for mtmsr/mfmsr since the msr on PPC64
is 64bits wide.  Define proper types for PPC64 if _LP64 is defined.
2002-08-14 15:41:57 +00:00
matt
571dd402e2 Add a bunch of mpc8xx SPR definitions. 2002-08-14 15:38:40 +00:00
matt
7f8f67eaed Re-enable PTE_EXEC. PTE_EXEC is now also cleared in pmap_zero_page,
pmap_copy_page, and pmap_clear_modify (pmap_clear_bit).  Remove #ifdef
MULTIPROCESSOR since the cache instructions operate on all caches on
all processors.
2002-08-14 14:25:15 +00:00
simonb
bff11b16da Remove the "comfound < 2" bogosity. 2002-08-14 12:31:38 +00:00
simonb
2eded71179 Remove an unused global variable (that was marked with an XXX!). 2002-08-14 12:29:50 +00:00
simonb
2f766ff3c2 Use the base space tag from the attach args, don't recreate it all the
time.
Clean up some include files.
2002-08-13 06:15:15 +00:00
simonb
f0302072f1 Use "ibm4xx" instead of "galaxy"; galaxy was an early code name for the
405GP.
2002-08-13 05:43:24 +00:00
simonb
42dede3769 Move 4xx devices to their own config include file so they can be used
elsewhere.
2002-08-13 05:29:25 +00:00
simonb
9e00d2d7f9 Fix include file location botch in previous. 2002-08-13 05:25:39 +00:00
simonb
497d6762cf Split out device register definitions to their own files as the are
common across many of the 4xx parts.  Leaves ibm405gp.h with device
address information specific to the 405GP CPU.  Now allows opb.c to
support multiple 4xx CPU types.
2002-08-13 04:57:48 +00:00
matt
c75c0aa911 Print DAR and DSISR on user ALIgnment traps (e.g. treat them as being
similar to DSI tracks).
2002-08-12 22:44:03 +00:00
simonb
b16f7fe1fc Add a pvr field to 'struct opb_dev', to allow the opb_devs array to
contain info about on-chip devices for more than one CPU type.
2002-08-12 07:55:08 +00:00
simonb
6bf1aaf8eb Reorganise the IBM 4xx bus layout, using terminology from the IBM
documentation:
 - Remove "mainbus" altogether.
 - The new root is "plb" - the Processor Local Bus.
 - Attached to this is the "opb" - the On-chip Peripheral Bus, to which
   all the on-chip devices are attached (except the cpu and pci host
   bridge).
 - Port-specific code can pass an array of 'struct plb_dev' to
   config_rootfound() to attach extra devices to the plb.  The walnut
   port attaches a "pbus" (Peripheral Bus) in here for the RTC and
   pc keyboard controller to attach to.
There is still much 405GP specific code; the next round of changes will
generalise this to enable easier support for other 4xx CPUs.
2002-08-12 02:06:18 +00:00
simonb
95319edf4a Add some IBM 4xx CPU PVR values; sort PVRs numerically.
White space nits.
2002-08-11 13:33:00 +00:00
simonb
ef1df3654e Define the 4xx PVR values in one place only. 2002-08-11 13:32:20 +00:00
matt
dcab4f46e8 Switch back to kenter_pa/kremove 2002-08-11 02:17:30 +00:00
matt
549ac19770 Add IBM Power3 CPUID. 2002-08-10 21:38:06 +00:00
matt
67f40b1907 More refinement, only map B_READ buf with VM_PROT_WRITE (all pages always
have VM_PROT_READ).  Also, pass PMAP_WIRED to pmap_enter (for non-mpc6xx
pmaps).  This will give pmap clues about flushing any "icache ok state".
2002-08-10 18:49:56 +00:00
matt
246ee3ef1d Switch vmap*buf back to using pmap_enter/pmap_remove. This is so that
accesses to the buffer will cause the reference and modified bits for
the pages to be udpated appropriately.
2002-08-10 16:28:49 +00:00
simonb
5b415a20e5 Fix for when EMAC_EVENT_COUNTERS isn't defined. Problem reported by
Allen Briggs.
2002-08-09 14:10:30 +00:00
simonb
acce3a5e36 Add a driver the for IBM 405gp (and possibly other IBM 4xx cpus) ethernet
MAC (emac).  Much thanks to Jason Thorpe for debugging help writing this
driver.  Tested on the walnut, and an earlier version of this driver works
on the OpenBlockSS.
2002-08-09 04:17:26 +00:00
matt
0fb9cba190 Add SPR_ASR from OEA-64. Change mfspr to use register_t. 2002-08-08 22:49:09 +00:00
chs
0a97a311e2 it's PPC_HAVE_FPU, not PPC_HAS_FPU.
also, include the headers that turn on FPU and AltiVec features
in case no one else does.
2002-08-08 01:27:35 +00:00
matt
e66a17771e Disable PTE_EXEC optimization until I figure out why it fails on 750 but
not 74xx.
2002-08-07 19:04:05 +00:00
tsubai
e373d8b520 Re-correct previous. It's intentional. 2002-08-07 08:01:57 +00:00
briggs
0b956d0b8b Implement pmc(9) -- An interface to hardware performance monitoring
counters.  These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface.  Initially, the Intel XScale
counters are the only ones supported.
2002-08-07 05:14:47 +00:00
matt
a2e9fe106d Correct __va_list typedef for GCC 3.* to match the GCC 3.* definition. 2002-08-07 00:11:59 +00:00
chs
f7fb853264 be sure to re-enable interrupts before calling trap() a second time
due to an AST.  the rule is that we must always have interrupts
enabled when acquiring kernel_lock, so that we can process blocking IPIs
from another CPU which is already holding kernel_lock.
reduce differences between the MP and non-MP versions of this file.
2002-08-06 06:21:58 +00:00
chs
f73abf90fb on MP systems, if the firmware didn't configure the L2 cache
on the non-boot CPUs, copy the L2CR configuration from the boot CPU.
also, fix the code that configures the L2 cache so that it works at all.
while I'm here, use mfspr() and mtspr() instead of inline asms.
2002-08-06 06:20:08 +00:00
chs
2928d8ba05 actually we shouldn't hold kernel_lock while calling postsig(). 2002-08-06 06:18:24 +00:00
chs
0924752f24 add the MSSCR0 register and some more L2CR fields. 2002-08-06 06:17:50 +00:00
chs
461184c6b6 fix the calculation of the address of the IPI dispatch register. 2002-08-06 06:16:42 +00:00
chs
301f1ebf31 move more inlines to cpu.h: mftb(), mftbl() and mfpvr().
(the mftb() in pmap.c only wanted the lower 32 bits, so that's now mftbl()).
2002-08-06 06:14:33 +00:00
enami
a55bfb4d51 A cosmetic change. 2002-08-05 02:56:58 +00:00
enami
1aaddc3669 - Care about carry bit when adding short value to force 4 byte boundary.
It may contain any 32 bit value there.
- Use correct instruction to clear carry bit.
- Don't use series of load with update instruction.  It's slower.
2002-08-05 02:55:39 +00:00
simonb
7cfa7d3ce0 Sprinkle a small amount of KNF. 2002-08-03 13:12:44 +00:00
chs
810cde53cc use a completely separate trap handler for syscall traps.
this reduces syscall overhead by 10% to 20% depending on cpu type.
2002-08-02 03:46:42 +00:00
simonb
d16ca1844f Add driver for 405gp (and other 4xx?) watchdog timer. 2002-08-01 23:15:37 +00:00
matt
3e158de7c1 Don't define register references if not KERNEL or STANDALONE. 2002-07-30 06:09:10 +00:00
itojun
f8e5e9c295 be friendly with gcc-3.1.1 -O2, which takes advantage of ANSI C
pointer aliasing rule (gcc optimization/7427).  from tsubai, sync w/kame
2002-07-29 09:14:36 +00:00
chs
03315186b6 install atomic.h. 2002-07-28 07:11:25 +00:00
chs
a7171ee431 add some atomic operations. 2002-07-28 07:09:28 +00:00
chs
fccc379b30 restructure the FPU and AltiVEC code so that it works for MP. 2002-07-28 07:07:44 +00:00
chs
64094057a1 resync the MP and non-MP trap_subr's. 2002-07-28 07:06:27 +00:00
chs
a7763f6e2c create a syscall_plain() like on other platforms
and avoid getting the kernel lock for MPSAFE syscalls.
2002-07-28 07:05:53 +00:00
chs
0e5816fca3 remove a local copy of mfmsr(). 2002-07-28 07:05:19 +00:00
chs
7f81a49168 propagate the MP idle-loop fix to ppc from the other ports:
Move call to sched_unlock_idle to later in the context switch to
  eliminate a race where another processor could grab the outgoing
  process before we were done saving our state into it, with predictable
  results.

  Bug spotted by Frank van der Linden <fvdl@wasabisystems.com>

also, don't re-enable interrupts temporarily in the middle of
switching to a new process, just wait until we're completely switched.
this didn't work on MP and it's not worth the effort.
2002-07-28 07:05:06 +00:00
chs
badae2dc11 disable the PTE_EXEC optimization for MP for now.
PTE_EXEC needs to become a per-CPU flag eventually.
2002-07-28 07:03:47 +00:00
chs
9b01e8d8ce split off the part of cpu_attach_common() that pokes at special CPU registers
into a separate function so that we can run it on each CPU we configure
rather than always on the boot CPU.
2002-07-28 07:03:15 +00:00
chs
84b41b2adb rearrange the PCB structure a bit so it's easier to look at in ddb. 2002-07-28 07:02:54 +00:00