source: trunk/source/lisp-kernel/platform-freebsdx8632.h

Last change on this file was 16685, checked in by rme, 4 years ago

Update copyright/license headers in files.

File size: 2.2 KB
Line 
1/*
2 * Copyright 1994-2010 Clozure Associates
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define WORD_SIZE 32
18#define PLATFORM_OS PLATFORM_OS_FREEBSD
19#define PLATFORM_CPU PLATFORM_CPU_X86
20#define PLATFORM_WORD_SIZE PLATFORM_WORD_SIZE_32
21
22typedef struct __ucontext ExceptionInformation;
23
24#define MAXIMUM_MAPPABLE_MEMORY (1U<<30)
25#define IMAGE_BASE_ADDRESS 0x30000000
26
27#include "lisptypes.h"
28#include "x86-constants32.h"
29
30#define REG_EDI 5
31#define REG_ESI 6
32#define REG_EBP 7
33#define REG_ISP 8
34#define REG_EBX 9
35#define REG_EDX 10
36#define REG_ECX 11
37#define REG_EAX 12
38#define REG_EIP 15
39#define REG_EFL 17
40#define REG_ESP 18
41
42#include <sys/types.h>
43#include <machine/npx.h>
44#define xpGPRvector(x) ((natural *)(&((x)->uc_mcontext)))
45#define xpGPR(x,gprno) (xpGPRvector(x)[gprno])
46#define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new)
47#define eflags_register(xp) xpGPR(xp,Iflags)
48#define xpPC(x) xpGPR(x,Iip)
49#define xpMMXreg(x,n) *((natural *)(&(((struct savexmm *)(&(x)->uc_mcontext.mc_fpstate))->sv_fp[n])))
50#define xpXMMregs(x)(&(((struct savexmm *)(&(x)->uc_mcontext.mc_fpstate))->sv_xmm[0]))
51#define xpMXCSR(x) ((struct savefpu *)((x)->uc_mcontext.mc_fpstate)->sv_env.en_mxcsr)
52extern void freebsd_sigreturn(ExceptionInformation *);
53#define SIGNUM_FOR_INTN_TRAP SIGBUS
54#define IS_MAYBE_INT_TRAP(info,xp) ((xp->uc_mcontext.mc_trapno == T_PROTFLT) && ((xp->uc_mcontext.mc_err & 7) == 2))
55#define IS_PAGE_FAULT(info,xp) (xp->uc_mcontext.mc_trapno == T_PAGEFLT)
56#define SIGRETURN(context) freebsd_sigreturn(context)
57
58#define AVX_CONTEXT_PRESENT(xp) ((xp)->uc_mcontext.mc_trapno & 4)
59#define AVX_CONTEXT_PTR(xp) (((xp)->uc_mcontext.mc_fpstate[130]))
60#define AVX_CONTEXT_SIZE(xp) ((natural)((xp)->uc_mcontext.mc_fpstate[131]))
61
62#include "os-freebsd.h"
Note: See TracBrowser for help on using the repository browser.