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

Last change on this file since 15267 was 15147, checked in by gb, 8 years ago

At least for x86: move some platform-specific constants (register indices)
from x86-constants*.h to platform-*.h. What a concept.

File size: 2.0 KB
RevLine 
[13597]1/*
2   Copyright (C) 2010 Clozure Associates
3   Copyright (C) 1994-2001 Digitool, Inc
4   This file is part of Clozure CL. 
5
6   Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
7   License , known as the LLGPL and distributed with Clozure CL as the
8   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
9   which is distributed with Clozure CL as the file "LGPL".  Where these
10   conflict, the preamble takes precedence. 
11
12   Clozure CL is referenced in the preamble as the "LIBRARY."
13
14   The LLGPL is also available online at
15   http://opensource.franz.com/preamble.html
16*/
17
18#define WORD_SIZE 32
[13608]19#define PLATFORM_OS PLATFORM_OS_FREEBSD
20#define PLATFORM_CPU PLATFORM_CPU_X86
21#define PLATFORM_WORD_SIZE PLATFORM_WORD_SIZE_32
[13597]22
23typedef struct __ucontext ExceptionInformation;
24
25#include "standard-inttypes.h"
26
27
[13617]28#define MAXIMUM_MAPPABLE_MEMORY (1U<<30)
29#define IMAGE_BASE_ADDRESS 0x30000000
[13597]30
[13627]31#include "lisptypes.h"
32#include "x86-constants32.h"
[13638]33
[15147]34#define REG_EDI 5
35#define REG_ESI 6
36#define REG_EBP 7
37#define REG_ISP 8
38#define REG_EBX 9
39#define REG_EDX 10
40#define REG_ECX 11
41#define REG_EAX 12
42#define REG_EIP 15
43#define REG_EFL 17
44#define REG_ESP 18
45
46
[13640]47#include "freebsdx8632/fpu.h"
[13638]48#define xpGPRvector(x) ((natural *)(&((x)->uc_mcontext)))
49#define xpGPR(x,gprno) (xpGPRvector(x)[gprno])
50#define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new)
51#define eflags_register(xp) xpGPR(xp,Iflags)
52#define xpPC(x) xpGPR(x,Iip)
53#define xpMMXreg(x,n) *((natural *)(&(((struct ccl_savexmm *)(&(x)->uc_mcontext.mc_fpstate))->sv_fp[n])))
54#define xpXMMregs(x)(&(((struct ccl_savexmm *)(&(x)->uc_mcontext.mc_fpstate))->sv_xmm[0]))
[13952]55#define xpMXCSR(x) ((struct savefpu *)((x)->uc_mcontext.mc_fpstate)->sv_env.en_mxcsr)
[13638]56extern void freebsd_sigreturn(ExceptionInformation *);
57#define SIGNUM_FOR_INTN_TRAP SIGBUS
58#define IS_MAYBE_INT_TRAP(info,xp) ((xp->uc_mcontext.mc_trapno == T_PROTFLT) && ((xp->uc_mcontext.mc_err & 7) == 2))
59#define IS_PAGE_FAULT(info,xp) (xp->uc_mcontext.mc_trapno == T_PAGEFLT)
60#define SIGRETURN(context) freebsd_sigreturn(context)
61
62#include "os-freebsd.h"
Note: See TracBrowser for help on using the repository browser.