Commit Graph

846 Commits

Author SHA1 Message Date
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