/* Copyright (C) 2016 Free Software Foundation, Inc. This file is part of GNU MIG. GNU MIG is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU MIG is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU MIG. If not, see . */ subsystem structs 0; import ; import ; #include "../base_types.defs" import ; import "types.h"; typedef int integer_t; typedef unsigned int natural_t; typedef natural_t mach_port_seqno_t; struct time_value { const integer_t seconds __attribute__ ((__aligned__(__alignof__(int)))); const integer_t microseconds; }; typedef struct time_value time_value_t; typedef struct mach_port_status { mach_port_t mps_pset; /* containing port set */ mach_port_seqno_t mps_seqno; /* sequence number */ natural_t mps_mscount; /* make-send count */ natural_t mps_qlimit; /* queue limit */ natural_t mps_msgcount; /* number in the queue */ natural_t mps_sorights; /* how many send-once rights */ natural_t mps_srights; /* do send rights exist? */ natural_t mps_pdrequest; /* port-deleted requested? */ natural_t mps_nsrequest; /* no-senders requested? */ } mach_port_status_t; typedef struct thread_basic_info { time_value_t user_time; /* user run time */ time_value_t system_time; /* system run time */ integer_t cpu_usage; /* scaled cpu usage percentage */ integer_t base_priority; /* base scheduling priority */ integer_t cur_priority; /* current scheduling priority */ integer_t run_state; /* run state (see below) */ integer_t flags; /* various flags (see below) */ integer_t suspend_count; /* suspend count for thread */ integer_t sleep_time; /* number of seconds that thread has been sleeping */ time_value_t creation_time; /* time stamp of creation */ } thread_basic_info_data_t; typedef struct padding_struct { char a; short b; enum { ENUM1, ENUM2, ENUM3 } c; int *d; char pad[(int) sizeof(int) == 4 ? 1 : 0]; unsigned int s1 : 8, s2 : 22; } padding_struct_t; typedef struct small_struct { char c1, c2; } small_struct_t; typedef struct i386_xfp_save { unsigned short fp_control; /* control */ unsigned short fp_status; /* status */ unsigned short fp_tag; /* register tags */ unsigned short fp_opcode; /* opcode of failed instruction */ unsigned int fp_eip; /* eip at failed instruction */ unsigned short fp_cs; /* cs at failed instruction */ unsigned short fp_unused_1; unsigned int fp_dp; /* data address */ unsigned short fp_ds; /* data segment */ unsigned short fp_unused_2; unsigned int fp_mxcsr; /* MXCSR */ unsigned int fp_mxcsr_mask; /* MXCSR_MASK */ unsigned char fp_reg_word[8][16]; /* space for 8 128-bit FP registers */ unsigned char fp_xreg_word[8][16]; /* space for 8 128-bit XMM registers */ unsigned int padding[56]; } __attribute__((aligned(16))) i386_xfp_save_t; routine usestruct(port : mach_port_t; str : mach_port_status_t; time : time_value_t; thread : thread_basic_info_data_t; padding : padding_struct_t; small : small_struct_t; fp_regs : i386_xfp_save_t; out result : mach_port_status_t);