Blame sysdeps/mach/i386/thread_state.h

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