Blame sysdeps/mach/i386/thread_state.h

Packit 6c4009
/* Mach thread state definitions for machine-independent code.  i386 version.
Packit 6c4009
   Copyright (C) 1994-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _MACH_I386_THREAD_STATE_H
Packit 6c4009
#define _MACH_I386_THREAD_STATE_H 1
Packit 6c4009
Packit 6c4009
#include <mach/machine/thread_status.h>
Packit 6c4009
Packit 6c4009
/* This lets the kernel define segments for a new thread.  */
Packit 6c4009
#define MACHINE_NEW_THREAD_STATE_FLAVOR	i386_THREAD_STATE
Packit 6c4009
/* This makes the kernel load our segments descriptors.  */
Packit 6c4009
#define MACHINE_THREAD_STATE_FLAVOR	i386_REGS_SEGS_STATE
Packit 6c4009
#define MACHINE_THREAD_STATE_COUNT	i386_THREAD_STATE_COUNT
Packit 6c4009
Packit 6c4009
#define machine_thread_state i386_thread_state
Packit 6c4009
Packit 6c4009
#define PC eip
Packit 6c4009
#define SP uesp
Packit 6c4009
#define SYSRETURN eax
Packit 6c4009
Packit 6c4009
#define MACHINE_THREAD_STATE_FIX_NEW(ts) do { \
Packit 6c4009
	asm ("mov %%cs, %w0" : "=q" ((ts)->cs)); \
Packit 6c4009
	asm ("mov %%ds, %w0" : "=q" ((ts)->ds)); \
Packit 6c4009
	asm ("mov %%es, %w0" : "=q" ((ts)->es)); \
Packit 6c4009
	asm ("mov %%fs, %w0" : "=q" ((ts)->fs)); \
Packit 6c4009
	asm ("mov %%gs, %w0" : "=q" ((ts)->gs)); \
Packit 6c4009
} while(0)
Packit 6c4009
Packit 6c4009
struct machine_thread_all_state
Packit 6c4009
  {
Packit 6c4009
    int set;			/* Mask of bits (1 << FLAVOR).  */
Packit 6c4009
    struct i386_thread_state basic;
Packit 6c4009
    struct i386_float_state fpu;
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
#include <sysdeps/mach/thread_state.h>
Packit 6c4009
Packit 6c4009
#endif /* mach/i386/thread_state.h */