Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / arm / fpe-arm / armfpe.h
blobe36004509629dd644317ccfce1f06e44a710bdfa
1 /* $NetBSD: armfpe.h,v 1.4 2005/12/11 12:16:46 christos Exp $ */
3 /*
4 * Copyright (c) 1995 Neil A Carson.
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Brini.
18 * 4. The name of the company nor the name of the author may be used to
19 * endorse or promote products derived from this software without specific
20 * prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
34 * RiscBSD kernel project
36 * armfpe.h
38 * Details of functions and structures needed for ARM FP cor
39 * support in RiscBSD
41 * Created : 04/01/96
44 #ifndef _ARMFPE_H_
45 #define _ARMFPE_H_
47 #include <machine/fp.h>
48 #include <machine/ieeefp.h>
49 #include <machine/reg.h>
51 #ifdef _KERNEL
54 * Type for a saved FP context, if we want to translate the context to a
55 * user-readable form
58 typedef struct fp_context_frame {
59 u_int32_t fpsr;
60 fp_extended_precision_t regs[8];
61 } fp_context_frame_t;
63 /* Define a structure that overlays the start of the core */
65 typedef struct {
67 * Addresses of procedures/functions
70 u_int32_t core_abort_addr;
71 u_int32_t core_initws_addr;
72 u_int32_t core_initcontext_addr;
73 u_int32_t core_changecontext_addr;
74 u_int32_t core_shutdown_addr;
75 u_int32_t core_activatecontext_addr;
76 u_int32_t core_deactivatecontext_addr;
77 u_int32_t core_savecontext_addr;
78 u_int32_t core_loadcontext_addr;
79 u_int32_t core_disable_addr;
80 u_int32_t core_enable_addr;
83 * Addresses of things that need to be filled in by the kernel on startup
86 u_int32_t *main_ws_ptr_addr;
87 u_int32_t *local_handler_ptr_addr;
88 u_int32_t *old_handler_ptr_addr;
89 u_int32_t *exc_handler_ptr_addr;
90 u_int32_t *fp_post_proc_addr;
93 * Constants that the kernel needs
96 u_int32_t workspacelength;
97 u_int32_t contextlength;
100 * Data pointers for extra information
102 u_char *core_identity_addr;
104 } arm_fpe_mod_hdr_t;
106 /* macro to return the FP context for a process */
108 #define FP_CONTEXT(p) ((u_int)(((u_char *)(p)->p_addr) + sizeof(struct user)))
110 /* Prototypes */
112 int arm_fpe_boot(void);
113 int initialise_arm_fpe(void);
114 void arm_fpe_postproc(u_int fpframe, struct trapframe *frame);
115 void arm_fpe_exception(int exception, u_int fpframe, struct trapframe *frame);
117 void arm_fpe_core_disable(void);
118 void arm_fpe_core_enable(void);
119 u_int arm_fpe_core_initws(u_int workspace, int handler1, int handler2);
120 u_int arm_fpe_core_abort(u_int context, int r12, int pc);
121 void arm_fpe_core_initcontext(u_int context);
122 u_int arm_fpe_core_changecontext(u_int context);
123 void arm_fpe_core_shutdown(void);
124 void arm_fpe_core_activatecontext(u_int context);
125 u_int arm_fpe_core_deactivatecontext(void);
126 u_int arm_fpe_core_savecontext(u_int context, fp_context_frame_t *savearea, int pc);
127 void arm_fpe_core_loadcontext(u_int context, const fp_context_frame_t *loadarea);
128 void arm_fpe_copycontext(u_int c1, u_int c2);
129 void arm_fpe_getcontext(struct proc *p, struct fpreg *fpregs);
130 void arm_fpe_setcontext(struct proc *p, const struct fpreg *fpregs);
132 void arm_fpe_exception_glue(int exception);
133 void arm_fpe_panic(void);
134 void undefined_entry(void);
135 void arm_fpe_post_proc_glue(void);
136 void arm_fpe_set_exception_mask(fp_except);
138 #endif /* _KERNEL */
139 #endif /* _ARMFPE_H_ */