machregs.h revision ae115bc77f6fcde83175c75b4206dc2e50747966
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _AMD64_MACHREGS_H
#define _AMD64_MACHREGS_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(_ASM)
/*
* AMD64 is somewhat unique in that it involves switching the state
* of the machine back and forth between being a complete implementation
* of an i386 processor, and a complete implementation of an amd64
* processor. As a result, it has to "know" about the state of both
* physical machines.
*/
#include <amd64/segments.h>
struct i386_machregs {
/*
* This is the privileged machine (register) state
*/
union {
} r_gdt_un;
union {
} r_idt_un;
/*
* The rest of this structure is an i386 'struct regs'
*/
};
/*
* XX64 need assertions to validate structure offsets are really
* what they need to be!
*/
struct amd64_machregs {
/*
* This is the privileged machine (register) state
* (Does NOT include amd64-specific MSRs, because boot doesn't
* touch them)
*
* XX64 An open question, however, is if the switch between amd64
* and i386 modes damages any of them -- we may need to save more
* than present below.
*/
union {
} r_gdt_un;
union {
} r_idt_un;
/*
* The rest of this structure is an amd64 'struct regs'
*
* It is intended to match the 'struct regs' definition
* in amd64/sys/privregs.h
*
* XX64 Need to ensure that it does!
*/
};
/*
* C-calling convention argument order:
*
* %rdi, %rsi, %rdx, %rcx, %r8, %r9
*
* and how to get them out of an amd64_machregs structure:
*/
#endif /* !_ASM */
#ifdef __cplusplus
}
#endif
#endif /* _AMD64_MACHREGS_H */