Add m68k to the big endian family.

Remove DOS CR from some files.
Add setjmp stuff for m68k (unfinished).
Moved arch specific stuff out of signal.h to arch/<arch>/signal.h
Added m68k vreg for signal.h (unfinished).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22703 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2007-10-25 00:36:36 +00:00
parent 5913d84eb8
commit 82a9fd6a48
9 changed files with 253 additions and 175 deletions

View File

@ -0,0 +1,12 @@
/*
* Copyright 2007, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _ARCH_SETJMP_H_
#define _ARCH_SETJMP_H_
#define _SETJMP_BUF_SZ (7+6+2+8*((96/8)/4))
typedef int __jmp_buf[_SETJMP_BUF_SZ];
#warning XXX: fix jmpbuf size
#endif /* _ARCH_SETJMP_H_ */

View File

@ -0,0 +1,26 @@
/*
* Copyright 2002-2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _ARCH_SIGNAL_H_
#define _ARCH_SIGNAL_H_
/*
* Architecture-specific structure passed to signal handlers
*/
#if __M68K__
struct vregs
{
ulong pc, /* program counter */
d0, d1, d2, d3, d4, d5, d6, d7,
a0, a1, a2, a3, a4, a5, a6, a7,
uchar ccr;
#warning M68K: fix floats in vregs, add missing stuff.
double f0, /* fp scratch */
f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13; /* fp volatile regs */
};
#endif /* __M68K__ */
#endif /* _ARCH_SIGNAL_H_ */

View File

@ -0,0 +1,32 @@
/*
* Copyright 2002-2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _ARCH_SIGNAL_H_
#define _ARCH_SIGNAL_H_
/*
* Architecture-specific structure passed to signal handlers
*/
#if __POWERPC__
struct vregs
{
ulong pc, /* program counter */
r0, /* scratch */
r1, /* stack ptr */
r2, /* TOC */
r3,r4,r5,r6,r7,r8,r9,r10, /* volatile regs */
r11,r12; /* scratch regs */
double f0, /* fp scratch */
f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13; /* fp volatile regs */
ulong filler1, /* place holder */
fpscr, /* fp condition codes */
ctr, xer, cr, msr, lr; /* misc. status */
};
#endif /* __POWERPC__ */
#endif /* _ARCH_SIGNAL_H_ */

View File

@ -0,0 +1,148 @@
/*
* Copyright 2002-2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _ARCH_SIGNAL_H_
#define _ARCH_SIGNAL_H_
/*
* Architecture-specific structure passed to signal handlers
*/
#if __INTEL__
typedef struct packed_fp_stack {
unsigned char st0[10];
unsigned char st1[10];
unsigned char st2[10];
unsigned char st3[10];
unsigned char st4[10];
unsigned char st5[10];
unsigned char st6[10];
unsigned char st7[10];
} packed_fp_stack;
typedef struct packed_mmx_regs {
unsigned char mm0[10];
unsigned char mm1[10];
unsigned char mm2[10];
unsigned char mm3[10];
unsigned char mm4[10];
unsigned char mm5[10];
unsigned char mm6[10];
unsigned char mm7[10];
} packed_mmx_regs;
typedef struct old_extended_regs {
unsigned short fp_control;
unsigned short _reserved1;
unsigned short fp_status;
unsigned short _reserved2;
unsigned short fp_tag;
unsigned short _reserved3;
unsigned long fp_eip;
unsigned short fp_cs;
unsigned short fp_opcode;
unsigned long fp_datap;
unsigned short fp_ds;
unsigned short _reserved4;
union {
packed_fp_stack fp;
packed_mmx_regs mmx;
} fp_mmx;
} old_extended_regs;
typedef struct fp_stack {
unsigned char st0[10];
unsigned char _reserved_42_47[6];
unsigned char st1[10];
unsigned char _reserved_58_63[6];
unsigned char st2[10];
unsigned char _reserved_74_79[6];
unsigned char st3[10];
unsigned char _reserved_90_95[6];
unsigned char st4[10];
unsigned char _reserved_106_111[6];
unsigned char st5[10];
unsigned char _reserved_122_127[6];
unsigned char st6[10];
unsigned char _reserved_138_143[6];
unsigned char st7[10];
unsigned char _reserved_154_159[6];
} fp_stack;
typedef struct mmx_regs {
unsigned char mm0[10];
unsigned char _reserved_42_47[6];
unsigned char mm1[10];
unsigned char _reserved_58_63[6];
unsigned char mm2[10];
unsigned char _reserved_74_79[6];
unsigned char mm3[10];
unsigned char _reserved_90_95[6];
unsigned char mm4[10];
unsigned char _reserved_106_111[6];
unsigned char mm5[10];
unsigned char _reserved_122_127[6];
unsigned char mm6[10];
unsigned char _reserved_138_143[6];
unsigned char mm7[10];
unsigned char _reserved_154_159[6];
} mmx_regs;
typedef struct xmmx_regs {
unsigned char xmm0[16];
unsigned char xmm1[16];
unsigned char xmm2[16];
unsigned char xmm3[16];
unsigned char xmm4[16];
unsigned char xmm5[16];
unsigned char xmm6[16];
unsigned char xmm7[16];
} xmmx_regs;
typedef struct new_extended_regs {
unsigned short fp_control;
unsigned short fp_status;
unsigned short fp_tag;
unsigned short fp_opcode;
unsigned long fp_eip;
unsigned short fp_cs;
unsigned short res_14_15;
unsigned long fp_datap;
unsigned short fp_ds;
unsigned short _reserved_22_23;
unsigned long mxcsr;
unsigned long _reserved_28_31;
union {
fp_stack fp;
mmx_regs mmx;
} fp_mmx;
xmmx_regs xmmx;
unsigned char _reserved_288_511[224];
} new_extended_regs;
typedef struct extended_regs {
union {
old_extended_regs old_format;
new_extended_regs new_format;
} state;
unsigned long format;
} extended_regs;
struct vregs {
unsigned long eip;
unsigned long eflags;
unsigned long eax;
unsigned long ecx;
unsigned long edx;
unsigned long esp;
unsigned long ebp;
unsigned long _reserved_1;
extended_regs xregs;
unsigned long _reserved_2[3];
};
#endif /* __INTEL__ */
#endif /* _ARCH_SIGNAL_H_ */

View File

@ -14,7 +14,7 @@
# define LITTLE_ENDIAN 1234
# define BIG_ENDIAN 0
# define BYTE_ORDER LITTLE_ENDIAN
#elif defined(__POWERPC__)
#elif defined(__POWERPC__) || defined(__M68K__)
# define BIG_ENDIAN 4321
# define LITTLE_ENDIAN 0
# define BYTE_ORDER BIG_ENDIAN

View File

@ -12,6 +12,10 @@
#include <arch/x86/arch_setjmp.h>
#elif __POWERPC__
#include <arch/ppc/arch_setjmp.h>
#elif __M68K__
#include <arch/m68k/arch_setjmp.h>
#else
#error #include <arch/<cpu>/arch_setjmp.h>
#endif
typedef struct __jmp_buf_tag {

View File

@ -261,160 +261,16 @@ sigdelset(sigset_t *set, int sig)
typedef struct vregs vregs;
// TODO: move those into an architecture specific header
#if __POWERPC__
struct vregs
{
ulong pc, /* program counter */
r0, /* scratch */
r1, /* stack ptr */
r2, /* TOC */
r3,r4,r5,r6,r7,r8,r9,r10, /* volatile regs */
r11,r12; /* scratch regs */
// include architecture specific definitions
#ifdef __INTEL__
#include <arch/x86/signal.h>
#elif __POWERPC__
#include <arch/ppc/signal.h>
#elif __M68K__
#include <arch/m68k/signal.h>
#else
#error #include <arch/<cpu>/signal.h>
#endif
double f0, /* fp scratch */
f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13; /* fp volatile regs */
ulong filler1, /* place holder */
fpscr, /* fp condition codes */
ctr, xer, cr, msr, lr; /* misc. status */
};
#endif /* __POWERPC__ */
#if __INTEL__
typedef struct packed_fp_stack {
unsigned char st0[10];
unsigned char st1[10];
unsigned char st2[10];
unsigned char st3[10];
unsigned char st4[10];
unsigned char st5[10];
unsigned char st6[10];
unsigned char st7[10];
} packed_fp_stack;
typedef struct packed_mmx_regs {
unsigned char mm0[10];
unsigned char mm1[10];
unsigned char mm2[10];
unsigned char mm3[10];
unsigned char mm4[10];
unsigned char mm5[10];
unsigned char mm6[10];
unsigned char mm7[10];
} packed_mmx_regs;
typedef struct old_extended_regs {
unsigned short fp_control;
unsigned short _reserved1;
unsigned short fp_status;
unsigned short _reserved2;
unsigned short fp_tag;
unsigned short _reserved3;
unsigned long fp_eip;
unsigned short fp_cs;
unsigned short fp_opcode;
unsigned long fp_datap;
unsigned short fp_ds;
unsigned short _reserved4;
union {
packed_fp_stack fp;
packed_mmx_regs mmx;
} fp_mmx;
} old_extended_regs;
typedef struct fp_stack {
unsigned char st0[10];
unsigned char _reserved_42_47[6];
unsigned char st1[10];
unsigned char _reserved_58_63[6];
unsigned char st2[10];
unsigned char _reserved_74_79[6];
unsigned char st3[10];
unsigned char _reserved_90_95[6];
unsigned char st4[10];
unsigned char _reserved_106_111[6];
unsigned char st5[10];
unsigned char _reserved_122_127[6];
unsigned char st6[10];
unsigned char _reserved_138_143[6];
unsigned char st7[10];
unsigned char _reserved_154_159[6];
} fp_stack;
typedef struct mmx_regs {
unsigned char mm0[10];
unsigned char _reserved_42_47[6];
unsigned char mm1[10];
unsigned char _reserved_58_63[6];
unsigned char mm2[10];
unsigned char _reserved_74_79[6];
unsigned char mm3[10];
unsigned char _reserved_90_95[6];
unsigned char mm4[10];
unsigned char _reserved_106_111[6];
unsigned char mm5[10];
unsigned char _reserved_122_127[6];
unsigned char mm6[10];
unsigned char _reserved_138_143[6];
unsigned char mm7[10];
unsigned char _reserved_154_159[6];
} mmx_regs;
typedef struct xmmx_regs {
unsigned char xmm0[16];
unsigned char xmm1[16];
unsigned char xmm2[16];
unsigned char xmm3[16];
unsigned char xmm4[16];
unsigned char xmm5[16];
unsigned char xmm6[16];
unsigned char xmm7[16];
} xmmx_regs;
typedef struct new_extended_regs {
unsigned short fp_control;
unsigned short fp_status;
unsigned short fp_tag;
unsigned short fp_opcode;
unsigned long fp_eip;
unsigned short fp_cs;
unsigned short res_14_15;
unsigned long fp_datap;
unsigned short fp_ds;
unsigned short _reserved_22_23;
unsigned long mxcsr;
unsigned long _reserved_28_31;
union {
fp_stack fp;
mmx_regs mmx;
} fp_mmx;
xmmx_regs xmmx;
unsigned char _reserved_288_511[224];
} new_extended_regs;
typedef struct extended_regs {
union {
old_extended_regs old_format;
new_extended_regs new_format;
} state;
unsigned long format;
} extended_regs;
struct vregs {
unsigned long eip;
unsigned long eflags;
unsigned long eax;
unsigned long ecx;
unsigned long edx;
unsigned long esp;
unsigned long ebp;
unsigned long _reserved_1;
extended_regs xregs;
unsigned long _reserved_2[3];
};
#endif /* __INTEL__ */
#endif /* _SIGNAL_H_ */