* Correct KINFO_PROC_SIZE for ARM EABI.
* Update the syscall interface to pass in the syscall value in register r7.
This commit is contained in:
parent
29ce0a2aff
commit
9fd57b44e4
@ -866,7 +866,11 @@ cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
|
||||
register_t *ap;
|
||||
int error;
|
||||
|
||||
#ifdef __ARM_EABI__
|
||||
sa->code = td->td_frame->tf_r7;
|
||||
#else
|
||||
sa->code = sa->insn & 0x000fffff;
|
||||
#endif
|
||||
ap = &td->td_frame->tf_r0;
|
||||
if (sa->code == SYS_syscall) {
|
||||
sa->code = *ap++;
|
||||
@ -905,16 +909,18 @@ syscall(struct thread *td, trapframe_t *frame)
|
||||
struct syscall_args sa;
|
||||
int error;
|
||||
|
||||
#ifndef __ARM_EABI__
|
||||
sa.insn = *(uint32_t *)(frame->tf_pc - INSN_SIZE);
|
||||
switch (sa.insn & SWI_OS_MASK) {
|
||||
case 0: /* XXX: we need our own one. */
|
||||
sa.nap = 4;
|
||||
break;
|
||||
default:
|
||||
call_trapsignal(td, SIGILL, 0);
|
||||
userret(td, frame);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
sa.nap = 4;
|
||||
|
||||
error = syscallenter(td, &sa);
|
||||
KASSERT(error != 0 || td->td_ar == NULL,
|
||||
|
@ -60,7 +60,11 @@ struct mdproc {
|
||||
void *md_sigtramp;
|
||||
};
|
||||
|
||||
#ifdef __ARM_EABI__
|
||||
#define KINFO_PROC_SIZE 816
|
||||
#else
|
||||
#define KINFO_PROC_SIZE 792
|
||||
#endif
|
||||
|
||||
#define MAXARGS 8
|
||||
struct syscall_args {
|
||||
@ -69,7 +73,9 @@ struct syscall_args {
|
||||
register_t args[MAXARGS];
|
||||
int narg;
|
||||
u_int nap;
|
||||
#ifndef __ARM_EABI__
|
||||
u_int32_t insn;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* !_MACHINE_PROC_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user