Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Aug 2001 17:02:35 -0700
From:      Paul Sulistio <sulistio@redback.com>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Mapping register to sigcontext and jmp_buf in freebsd-uthread.c
Message-ID:  <3B90259B.780D15CA@redback.com>

next in thread | raw e-mail | index | archive | help
Hi,

How to map the registers to sigcontext and jmp_buf in freebsd-uthread.c
I need to port this feature from freebsd to netbsd.
where do these values come from?

Thanks
-Paul
------
#ifdef __i386__

static char sigmap[NUM_REGS] =  /* map reg to sigcontext  */
{
 11,                            /* eax */
 10,                            /* ecx */
  9,                            /* edx */
  8,                            /* ebx */
  15,                           /* esp */
  7,                            /* ebp */
  6,                            /* esi */
  5,                            /* edi */
  12,                           /* eip */
  14,                           /* eflags */
  13,                           /* cs */
  16,                           /* ss */
  4,                            /* ds */
  3,                            /* es */
  2,                            /* fs */
  1,                            /* gs */
};

static char jmpmap[NUM_REGS] = /* map reg to jmp_buf */
{
  6,                            /* eax */
  -1,                           /* ecx */
  -1,                           /* edx */
  1,                            /* ebx */
  2,                            /* esp */
  3,                            /* ebp */
  4,                            /* esi */
  5,                            /* edi */
  0,                            /* eip */
  -1,                           /* eflags */
  -1,                           /* cs */
  -1,                           /* ss */
  -1,                           /* ds */
  -1,                           /* es */
  -1,                           /* fs */
  -1,                           /* gs */
};


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B90259B.780D15CA>