source: branches/arm/lisp-kernel/platform-darwinppc.h @ 13923

Last change on this file since 13923 was 13643, checked in by gb, 9 years ago

Changed files from trunk.

File size: 2.5 KB
Line 
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 3
19#define PLATFORM_OS PLATFORM_OS_DARWIN
20#define PLATFORM_CPU PLATFORM_CPU_PPC
21#define PLATFORM_WORD_SIZE PLATFORM_WORD_SIZE_32
22
23#include <sys/signal.h>
24#include <sys/ucontext.h>
25
26/* ucontext/mcontext stuff; saner if OS >= 10.5 */
27typedef ucontext_t ExceptionInformation;
28typedef mcontext_t MCONTEXT_T;
29#define UC_MCONTEXT(UC) UC->uc_mcontext
30
31#include "standard-inttypes.h"
32
33#define MAXIMUM_MAPPABLE_MEMORY ((1U<<31)-2*heap_segment_size)
34#define IMAGE_BASE_ADDRESS 0x04000000
35
36#include "lisptypes.h"
37#include "ppc-constants32.h"
38
39/* xp accessors.  Logically identical on darwinppc32/64. */
40#define xpGPRvector(x) (&(UC_MCONTEXT(x)->__ss.__r0))
41#define xpGPR(x,gprno) ((xpGPRvector(x))[gprno])
42#define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (UInt32)(new)
43#define xpPC(x) (*((pc*) &(UC_MCONTEXT(x)->__ss.__srr0)))
44#define set_xpPC(x,new) (xpPC(x) = (pc)(new))
45#define xpLR(x) (*((pc*)(&(UC_MCONTEXT(x)->__ss.__lr))))
46#define xpCTR(x) (*(pc*)(&(UC_MCONTEXT(x)->__ss.__ctr)))
47#define xpXER(x) (UC_MCONTEXT(x)->__ss.__xer)
48#define xpCCR(x) (UC_MCONTEXT(x)->__ss.__cr)
49#define xpMSR(x) (UC_MCONTEXT(x)->__ss.__srr1)
50#define xpDSISR(x) (UC_MCONTEXT(x)->__es.__dsisr)
51#define xpDAR(x) (UC_MCONTEXT(x)->__es.__dar)
52#define xpTRAP(x) (UC_MCONTEXT(x)->__es.__exception)
53#define xpFPSCR(x) (UC_MCONTEXT(x)->__fs.__fpscr)
54#define xpFPRvector(x) (UC_MCONTEXT(x)->__fs.__fpregs)
55#define xpFPR(x,fprno) (xpFPRvector(x)[fprno])
56
57/* Late versions of OSX 10.2 had a bug in 32-bit exception handling;
58   machine context wasn't restored correctly if it wasn't modified
59   by the exception handler.  DarwinSigReturn() was a macro that
60   tried to work around this.
61*/
62#define DarwinSigReturn(x)
63
64/* On some platforms, we may need to do something more than returning
65   from a signal handler in order to return to the kernel and let it
66   restore context.  On DarwinPPC, that's not a factor.
67*/
68#define SIGRETURN(context)
69
70#include "os-darwin.h"
Note: See TracBrowser for help on using the repository browser.