The fp_status fasttrap is called processor_facilities_used in userland, and

we discovered the flags it was to collect. Now we need to emulate them, but
it is another story.

load_msr seems only used from kernel code.
This commit is contained in:
manu 2002-12-07 19:05:11 +00:00
parent 6b57b095ae
commit e03fbf9432
6 changed files with 34 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mach_fasttraps_cpu.c,v 1.1 2002/11/03 23:17:20 manu Exp $ */
/* $NetBSD: mach_fasttraps_cpu.c,v 1.2 2002/12/07 19:05:11 manu Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_cpu.c,v 1.1 2002/11/03 23:17:20 manu Exp $");
__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_cpu.c,v 1.2 2002/12/07 19:05:11 manu Exp $");
#include <sys/types.h>
#include <sys/systm.h>
@ -46,16 +46,33 @@ __KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_cpu.c,v 1.1 2002/11/03 23:17:20 manu
#include <compat/mach/arch/powerpc/fasttraps/mach_fasttraps_syscall.h>
#include <compat/mach/arch/powerpc/fasttraps/mach_fasttraps_syscallargs.h>
#define mach_ignoreZeroFaultbit 0
#define mach_floatUsedbit 1
#define mach_vectorUsedbit 2
#define mach_runningVMbit 4
#define mach_floatCngbit 5
#define mach_vectorCngbit 6
#define mach_timerPopbit 7
#define mach_userProtKeybit 8
#define mach_trapUnalignbit 9
#define mach_notifyUnalignbit 10
#define mach_bbThreadbit 28
#define mach_bbNoMachSCbit 29
#define mach_bbPreemptivebit 30
#define mach_spfReserved1 31
/* We do not emulate anything here right now */
int
mach_sys_fp_status(p, v, retval)
mach_sys_processor_facilities_used(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
printf("mach_sys_fp_status()\n");
*retval = 0;
return 0;
}
/* This seems to be called only from within the kernel in Mach */
int
mach_sys_load_msr(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mach_fasttraps_syscall.h,v 1.3 2002/12/07 15:33:36 manu Exp $ */
/* $NetBSD: mach_fasttraps_syscall.h,v 1.4 2002/12/07 19:05:11 manu Exp $ */
/*
* System call numbers.
@ -13,8 +13,8 @@
/* syscall: "cthread_self" ret: "mach_cproc_t" args: */
#define MACH_FASTTRAPS_SYS_cthread_self 2
/* syscall: "fp_status" ret: "void" args: */
#define MACH_FASTTRAPS_SYS_fp_status 3
/* syscall: "processor_facilities_used" ret: "int" args: */
#define MACH_FASTTRAPS_SYS_processor_facilities_used 3
/* syscall: "load_msr" ret: "void" args: */
#define MACH_FASTTRAPS_SYS_load_msr 4

View File

@ -1,4 +1,4 @@
/* $NetBSD: mach_fasttraps_syscallargs.h,v 1.3 2002/12/07 15:33:37 manu Exp $ */
/* $NetBSD: mach_fasttraps_syscallargs.h,v 1.4 2002/12/07 19:05:11 manu Exp $ */
/*
* System call argument lists.
@ -37,6 +37,6 @@ struct mach_sys_cthread_set_self_args {
int mach_sys_cthread_set_self(struct proc *, void *, register_t *);
int mach_sys_cthread_self(struct proc *, void *, register_t *);
int mach_sys_fp_status(struct proc *, void *, register_t *);
int mach_sys_processor_facilities_used(struct proc *, void *, register_t *);
int mach_sys_load_msr(struct proc *, void *, register_t *);
#endif /* _MACH_FASTTRAPS_SYS__SYSCALLARGS_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: mach_fasttraps_syscalls.c,v 1.3 2002/12/07 15:33:37 manu Exp $ */
/* $NetBSD: mach_fasttraps_syscalls.c,v 1.4 2002/12/07 19:05:11 manu Exp $ */
/*
* System call names.
@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_syscalls.c,v 1.3 2002/12/07 15:33:37 manu Exp $");
__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_syscalls.c,v 1.4 2002/12/07 19:05:11 manu Exp $");
#if defined(_KERNEL_OPT)
#include <sys/param.h>
@ -25,7 +25,7 @@ const char *const mach_fasttraps_syscallnames[] = {
"#0 (unimplemented)", /* 0 = unimplemented */
"cthread_set_self", /* 1 = cthread_set_self */
"cthread_self", /* 2 = cthread_self */
"fp_status", /* 3 = fp_status */
"processor_facilities_used", /* 3 = processor_facilities_used */
"load_msr", /* 4 = load_msr */
"#5 (unimplemented)", /* 5 = unimplemented */
"#6 (unimplemented)", /* 6 = unimplemented */

View File

@ -1,4 +1,4 @@
/* $NetBSD: mach_fasttraps_sysent.c,v 1.3 2002/12/07 15:33:37 manu Exp $ */
/* $NetBSD: mach_fasttraps_sysent.c,v 1.4 2002/12/07 19:05:11 manu Exp $ */
/*
* System call switch table.
@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_sysent.c,v 1.3 2002/12/07 15:33:37 manu Exp $");
__KERNEL_RCSID(0, "$NetBSD: mach_fasttraps_sysent.c,v 1.4 2002/12/07 19:05:11 manu Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -29,7 +29,7 @@ struct sysent mach_fasttraps_sysent[] = {
{ 0, 0, 0,
mach_sys_cthread_self }, /* 2 = cthread_self */
{ 0, 0, 0,
mach_sys_fp_status }, /* 3 = fp_status */
mach_sys_processor_facilities_used },/* 3 = processor_facilities_used */
{ 0, 0, 0,
mach_sys_load_msr }, /* 4 = load_msr */
{ 0, 0, 0,

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.2 2002/12/07 15:33:03 manu Exp $
$NetBSD: syscalls.master,v 1.3 2002/12/07 19:05:12 manu Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@ -46,7 +46,7 @@
0 UNIMPL
1 STD { void mach_sys_cthread_set_self(mach_cproc_t p); }
2 STD { mach_cproc_t mach_sys_cthread_self(void); }
3 STD { void mach_sys_fp_status(void); }
3 STD { int mach_sys_processor_facilities_used(void); }
4 STD { void mach_sys_load_msr(void); }
5 UNIMPL
6 UNIMPL