source: release/1.9/source/lisp-kernel/platform-win64.h @ 16083

Last change on this file since 16083 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.1 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 64
19#define PLATFORM_OS PLATFORM_OS_WINDOWS
20#define PLATFORM_CPU PLATFORM_CPU_X86
21#define PLATFORM_WORD_SIZE PLATFORM_WORD_SIZE_64
22
23#include <windows.h>
24
25typedef CONTEXT ExceptionInformation;
26
27#include "windows-inttypes.h"
28
29/* Supposedly, the high-end version of Vista allow 128GB of pageable memory */
30#define MAXIMUM_MAPPABLE_MEMORY (512LL<<30LL)
31#define IMAGE_BASE_ADDRESS 0x100000000LL
32
33#include "lisptypes.h"
34#include "x86-constants64.h"
35
36/* DWORD64 indices in &(CONTEXT->Rax) */
37#define REG_RAX     0
38#define REG_RCX     1
39#define REG_RDX     2
40#define REG_RBX     3
41#define REG_RSP     4
42#define REG_RBP     5
43#define REG_RSI     6
44#define REG_RDI     7
45#define REG_R8      8
46#define REG_R9      9
47#define REG_R10     10
48#define REG_R11     11
49#define REG_R12     12
50#define REG_R13     13
51#define REG_R14     14
52#define REG_R15     15
53#define REG_RIP     16
54
55#define xpGPRvector(x) ((DWORD64 *)(&(x)->Rax))
56#define xpGPR(x,gprno) (xpGPRvector(x)[gprno])
57#define xpPC(x) xpGPR(x,Iip)
58#define eflags_register(xp) xp->EFlags
59#define xpMXCSRptr(x) (DWORD *)(&(x->MxCsr))
60#define xpMXCSR(x) ((x)->MxCsr)
61
62#define SIGNUM_FOR_INTN_TRAP SIGSEGV /* Also fake */
63#define IS_MAYBE_INT_TRAP(info,xp) \
64  ((info->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) &&       \
65   (info->ExceptionInformation[0]==0) &&                       \
66   (info->ExceptionInformation[1]==(ULONG_PTR)(-1L)))
67#define IS_PAGE_FAULT(info,xp) (1)
68#define SIGRETURN(context)      /* for now */
69
70#include "os-windows.h"
Note: See TracBrowser for help on using the repository browser.