reg.h revision 1.2
11.2Sagc/* $NetBSD: reg.h,v 1.2 2003/08/07 16:26:36 agc Exp $ */ 21.1Sfvdl 31.1Sfvdl/*- 41.1Sfvdl * Copyright (c) 1990 The Regents of the University of California. 51.1Sfvdl * All rights reserved. 61.1Sfvdl * 71.1Sfvdl * This code is derived from software contributed to Berkeley by 81.1Sfvdl * William Jolitz. 91.1Sfvdl * 101.1Sfvdl * Redistribution and use in source and binary forms, with or without 111.1Sfvdl * modification, are permitted provided that the following conditions 121.1Sfvdl * are met: 131.1Sfvdl * 1. Redistributions of source code must retain the above copyright 141.1Sfvdl * notice, this list of conditions and the following disclaimer. 151.1Sfvdl * 2. Redistributions in binary form must reproduce the above copyright 161.1Sfvdl * notice, this list of conditions and the following disclaimer in the 171.1Sfvdl * documentation and/or other materials provided with the distribution. 181.2Sagc * 3. Neither the name of the University nor the names of its contributors 191.1Sfvdl * may be used to endorse or promote products derived from this software 201.1Sfvdl * without specific prior written permission. 211.1Sfvdl * 221.1Sfvdl * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 231.1Sfvdl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 241.1Sfvdl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 251.1Sfvdl * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 261.1Sfvdl * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 271.1Sfvdl * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 281.1Sfvdl * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 291.1Sfvdl * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 301.1Sfvdl * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 311.1Sfvdl * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 321.1Sfvdl * SUCH DAMAGE. 331.1Sfvdl * 341.1Sfvdl * @(#)reg.h 5.5 (Berkeley) 1/18/91 351.1Sfvdl */ 361.1Sfvdl 371.1Sfvdl#ifndef _AMD64_REG_H_ 381.1Sfvdl#define _AMD64_REG_H_ 391.1Sfvdl 401.1Sfvdl#include <machine/mcontext.h> 411.1Sfvdl 421.1Sfvdl/* 431.1Sfvdl * XXX 441.1Sfvdl * The #defines aren't used in the kernel, but some user-level code still 451.1Sfvdl * expects them. 461.1Sfvdl */ 471.1Sfvdl 481.1Sfvdl/* When referenced during a trap/exception, registers are at these offsets */ 491.1Sfvdl 501.1Sfvdl#define tR15 0 511.1Sfvdl#define tR14 1 521.1Sfvdl#define tR13 2 531.1Sfvdl#define tR12 3 541.1Sfvdl#define tR11 4 551.1Sfvdl#define tR10 5 561.1Sfvdl#define tR9 6 571.1Sfvdl#define tR8 7 581.1Sfvdl#define tRDI 8 591.1Sfvdl#define tRSI 9 601.1Sfvdl#define tRBP 10 611.1Sfvdl#define tRBX 11 621.1Sfvdl#define tRDX 12 631.1Sfvdl#define tRCX 13 641.1Sfvdl#define tRAX 14 651.1Sfvdl 661.1Sfvdl#define tRIP 17 671.1Sfvdl#define tCS 18 681.1Sfvdl#define tRFLAGS 19 691.1Sfvdl#define tRSP 20 701.1Sfvdl#define tSS 21 711.1Sfvdl 721.1Sfvdl/* 731.1Sfvdl * Registers accessible to ptrace(2) syscall for debugger use. 741.1Sfvdl * Same as mcontext.__gregs and struct trapframe, they must 751.1Sfvdl * remain synced (XXX should use common structure). 761.1Sfvdl */ 771.1Sfvdlstruct reg { 781.1Sfvdl long regs[_NGREG]; 791.1Sfvdl}; 801.1Sfvdl 811.1Sfvdlstruct fpreg { 821.1Sfvdl struct fxsave64 fxstate; 831.1Sfvdl}; 841.1Sfvdl 851.1Sfvdl#define fp_fcw fxstate.fx_fcw 861.1Sfvdl#define fp_fsw fxstate.fx_fsw 871.1Sfvdl#define fp_ftw fxstate.fx_ftw 881.1Sfvdl#define fp_fop fxstate.fx_fop 891.1Sfvdl#define fp_rip fxstate.fx_rip 901.1Sfvdl#define fp_rdp fxstate.fx_rdp 911.1Sfvdl#define fp_mxcsr fxstate.fx_mxcsr 921.1Sfvdl#define fp_mxcsr_mask fxstate.fx_mxcsr_mask 931.1Sfvdl#define fp_st fxstate.fx_st 941.1Sfvdl#define fp_xmm fxstate.fx_xmm 951.1Sfvdl 961.1Sfvdl#endif /* !_AMD64_REG_H_ */ 97