Back to index

glibc  2.9
Classes | Defines | Functions
intr-msg.h File Reference
#include "hurdfault.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mach_msg_trap_args

Defines

#define INTR_MSG_TRAP(msg, option, send_size, rcv_size, rcv_name, timeout, notify)
#define SYSCALL_EXAMINE(state, callno)
#define MSG_EXAMINE(state, msgid, rcvname, send_name, opt, tmout)

Functions

static void INTR_MSG_BACK_OUT (struct i386_thread_state *state)

Class Documentation

struct mach_msg_trap_args

Definition at line 99 of file intr-msg.h.

Class Members
mach_msg_header_t * msg
mach_port_t notify
mach_msg_option_t option
mach_port_t rcv_name
mach_msg_size_t rcv_size
void * retaddr
mach_msg_size_t send_size
mach_msg_timeout_t timeout

Define Documentation

#define INTR_MSG_TRAP (   msg,
  option,
  send_size,
  rcv_size,
  rcv_name,
  timeout,
  notify 
)
Value:
({                                                                   \
  error_t err;                                                              \
  asm (".globl _hurd_intr_rpc_msg_do_trap\n"                                \
       ".globl _hurd_intr_rpc_msg_in_trap\n"                                \
       ".globl _hurd_intr_rpc_msg_cx_sp\n"                                  \
       ".globl _hurd_intr_rpc_msg_sp_restored\n"                     \
       "                           movl %%esp, %%ecx\n"              \
       "                           leal %3, %%esp\n"                 \
       "_hurd_intr_rpc_msg_cx_sp:  movl $-25, %%eax\n"               \
       "_hurd_intr_rpc_msg_do_trap:       lcall $7, $0 # status in %0\n"           \
       "_hurd_intr_rpc_msg_in_trap:       movl %%ecx, %%esp\n"              \
       "_hurd_intr_rpc_msg_sp_restored:"                             \
       : "=a" (err), "=m" (option), "=m" (timeout)                          \
       : "m" ((&msg)[-1]), "1" (option), "2" (timeout)                      \
       : "%ecx");                                                    \
  err;                                                               \
})

Definition at line 24 of file intr-msg.h.

#define MSG_EXAMINE (   state,
  msgid,
  rcvname,
  send_name,
  opt,
  tmout 
)
Value:
({                                                                   \
  const struct mach_msg_trap_args *args = (const void *) (state)->uesp;            \
  mach_msg_header_t *msg;                                            \
  _hurdsig_catch_memory_fault (args) ? -1 :                                 \
    ({                                                               \
      msg = args->msg;                                                      \
      *(opt) = args->option;                                                \
      *(tmout) = args->timeout;                                             \
      *(rcvname) = args->rcv_name;                                   \
      _hurdsig_end_catch_fault ();                                   \
      if (msg == 0)                                                  \
       {                                                             \
         *(send_name) = MACH_PORT_NULL;                              \
         *(msgid) = 0;                                                      \
       }                                                             \
      else                                                           \
       {                                                             \
         if (_hurdsig_catch_memory_fault (msg))                      \
           return -1;                                                       \
         *(send_name) = msg->msgh_remote_port;                              \
         *(msgid) = msg->msgh_id;                                    \
         _hurdsig_end_catch_fault ();                                       \
       }                                                             \
      0;                                                             \
    });                                                                     \
})

Definition at line 86 of file intr-msg.h.

#define SYSCALL_EXAMINE (   state,
  callno 
)
Value:
({                                                                   \
  struct { unsigned int c[2]; } *p = (void *) ((state)->eip - 7);           \
  int result;                                                        \
  if (_hurdsig_catch_memory_fault (p))                                      \
    return 0;                                                        \
  if (result = p->c[0] == 0x0000009a && (p->c[1] & 0x00ffffff) == 0x00000700) \
    /* The PC is just after an `lcall $7,$0' instruction.                   \
       This is a system call in progress; %eax holds the call number.  */     \
    *(callno) = (state)->eax;                                               \
  _hurdsig_end_catch_fault ();                                              \
  result;                                                            \
})

Definition at line 57 of file intr-msg.h.


Function Documentation

static void INTR_MSG_BACK_OUT ( struct i386_thread_state *  state) [inline, static]

Definition at line 45 of file intr-msg.h.

{
  extern const void _hurd_intr_rpc_msg_cx_sp;
  if (state->eip >= (natural_t) &_hurd_intr_rpc_msg_cx_sp)
    state->uesp = state->ecx;
  else
    state->ecx = state->uesp;
}