forked from Imagelibrary/rtems
Initial attempt at building HP PA-RISC using Solaris hosted tools.
Changed back to Newlib for Solaris UNIX simulator.
This commit is contained in:
@@ -119,10 +119,19 @@ libc_switch_hook(rtems_tcb *current_task,
|
|||||||
/* XXX We can't use rtems_task_set_note() here since SYSI task has a
|
/* XXX We can't use rtems_task_set_note() here since SYSI task has a
|
||||||
* tid of 0, which is treated specially (optimized, actually)
|
* tid of 0, which is treated specially (optimized, actually)
|
||||||
* by rtems_task_set_note
|
* by rtems_task_set_note
|
||||||
|
*
|
||||||
|
* NOTE: The above comment is no longer true and we need to use
|
||||||
|
* the extension data areas added about the same time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Don't touch the outgoing task if it has been deleted.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( !_States_Is_transient( current_task->current_state ) ) {
|
||||||
impure_value = (rtems_unsigned32) _REENT;
|
impure_value = (rtems_unsigned32) _REENT;
|
||||||
MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
|
MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
|
||||||
|
}
|
||||||
|
|
||||||
_REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
|
_REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
|
||||||
|
|
||||||
@@ -171,7 +180,8 @@ libc_delete_hook(rtems_tcb *current_task,
|
|||||||
ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
|
ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ptr)
|
/* if (ptr) */
|
||||||
|
if (ptr && ptr != &libc_global_reent)
|
||||||
{
|
{
|
||||||
_wrapup_reent(ptr);
|
_wrapup_reent(ptr);
|
||||||
_reclaim_reent(ptr);
|
_reclaim_reent(ptr);
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ void hppa_external_interrupt(unsigned32, CPU_Interrupt_frame *);
|
|||||||
* So we use our own prototype instead of rtems_isr_entry
|
* So we use our own prototype instead of rtems_isr_entry
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef rtems_isr ( *hppa_rtems_isr_entry )(
|
typedef void ( *hppa_rtems_isr_entry )(
|
||||||
rtems_vector_number,
|
ISR_Vector_number,
|
||||||
CPU_Interrupt_frame *
|
CPU_Interrupt_frame *
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ void _CPU_ISR_install_vector(
|
|||||||
void
|
void
|
||||||
hppa_external_interrupt_initialize(void)
|
hppa_external_interrupt_initialize(void)
|
||||||
{
|
{
|
||||||
rtems_isr_entry ignore;
|
hppa_rtems_isr_entry ignore;
|
||||||
|
|
||||||
/* mark them all unused */
|
/* mark them all unused */
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ void _MPCI_Handler_initialization(
|
|||||||
THREAD_QUEUE_DISCIPLINE_FIFO,
|
THREAD_QUEUE_DISCIPLINE_FIFO,
|
||||||
STATES_WAITING_FOR_RPC_REPLY,
|
STATES_WAITING_FOR_RPC_REPLY,
|
||||||
NULL,
|
NULL,
|
||||||
RTEMS_TIMEOUT
|
RTEMS_TIMEOUT /* XXX */
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -471,6 +471,9 @@ void _Thread_Close(
|
|||||||
|
|
||||||
if ( the_thread->extensions )
|
if ( the_thread->extensions )
|
||||||
(void) _Workspace_Free( the_thread->extensions );
|
(void) _Workspace_Free( the_thread->extensions );
|
||||||
|
|
||||||
|
the_thread->Start.stack = NULL;
|
||||||
|
the_thread->extensions = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
|
|||||||
@@ -24,12 +24,14 @@
|
|||||||
|
|
||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
|
|
||||||
|
void print_information( void );
|
||||||
|
|
||||||
int main(
|
int main(
|
||||||
int argc,
|
int argc,
|
||||||
char **argv
|
char **argv
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
unsigned int size;
|
unsigned int size = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print the file header
|
* Print the file header
|
||||||
@@ -59,10 +61,6 @@ printf(
|
|||||||
"\n"
|
"\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
* Offsets of elements in the Context_control structure.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define PRINT_IT( STRING, TYPE, FIELD ) \
|
#define PRINT_IT( STRING, TYPE, FIELD ) \
|
||||||
printf( "#define\t%s\t0x%p\t\t/* %d */\n", \
|
printf( "#define\t%s\t0x%p\t\t/* %d */\n", \
|
||||||
STRING, \
|
STRING, \
|
||||||
@@ -84,6 +82,12 @@ printf(
|
|||||||
"\n" \
|
"\n" \
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#if defined(hpux) && defined(__hppa__)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Offsets of elements in the Context_control structure.
|
||||||
|
*/
|
||||||
|
|
||||||
PRINT_COMMENT("Context_Control information");
|
PRINT_COMMENT("Context_Control information");
|
||||||
|
|
||||||
PRINT_IT( "FLAGS_OFFSET", Context_Control *, flags );
|
PRINT_IT( "FLAGS_OFFSET", Context_Control *, flags );
|
||||||
@@ -172,6 +176,12 @@ printf(
|
|||||||
|
|
||||||
printf( "#define\tCPU_INTERRUPT_FRAME_SIZE\t%d\t\t/* 0x%x */\n", size, size );
|
printf( "#define\tCPU_INTERRUPT_FRAME_SIZE\t%d\t\t/* 0x%x */\n", size, size );
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
print_information();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef PRINT_IT
|
#undef PRINT_IT
|
||||||
#undef PRINT_SIZE
|
#undef PRINT_SIZE
|
||||||
#undef PRINT_COMMENT
|
#undef PRINT_COMMENT
|
||||||
@@ -189,3 +199,117 @@ printf(
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void print_information( void )
|
||||||
|
{
|
||||||
|
|
||||||
|
#define PRINT_IT( STRING, NUMBER ) \
|
||||||
|
printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
|
||||||
|
STRING, \
|
||||||
|
NUMBER, \
|
||||||
|
NUMBER );
|
||||||
|
|
||||||
|
#define PRINT_SIZE( STRING, NUMBER ) \
|
||||||
|
printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
|
||||||
|
STRING, \
|
||||||
|
NUMBER, \
|
||||||
|
NUMBER );
|
||||||
|
|
||||||
|
#define PRINT_COMMENT( STRING ) \
|
||||||
|
printf( \
|
||||||
|
"\n" \
|
||||||
|
"/*\n" \
|
||||||
|
" * " STRING "\n" \
|
||||||
|
" */\n" \
|
||||||
|
"\n" \
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Offsets of elements in the Context_control structure.
|
||||||
|
*/
|
||||||
|
|
||||||
|
PRINT_COMMENT("Context_Control information");
|
||||||
|
|
||||||
|
PRINT_IT( "FLAGS_OFFSET", 0x00 );
|
||||||
|
PRINT_IT( "R1_OFFSET", 0x04 );
|
||||||
|
PRINT_IT( "R2_OFFSET", 0x08 );
|
||||||
|
PRINT_IT( "R3_OFFSET", 0x0c );
|
||||||
|
PRINT_IT( "R4_OFFSET", 0x00 );
|
||||||
|
PRINT_IT( "R5_OFFSET", 0x14 );
|
||||||
|
PRINT_IT( "R6_OFFSET", 0x18 );
|
||||||
|
PRINT_IT( "R7_OFFSET", 0x1c );
|
||||||
|
PRINT_IT( "R8_OFFSET", 0x20 );
|
||||||
|
PRINT_IT( "R9_OFFSET", 0x24 );
|
||||||
|
PRINT_IT( "R10_OFFSET", 0x28 );
|
||||||
|
PRINT_IT( "R11_OFFSET", 0x2c );
|
||||||
|
PRINT_IT( "R12_OFFSET", 0x30 );
|
||||||
|
PRINT_IT( "R13_OFFSET", 0x34 );
|
||||||
|
PRINT_IT( "R14_OFFSET", 0x38 );
|
||||||
|
PRINT_IT( "R15_OFFSET", 0x3c );
|
||||||
|
PRINT_IT( "R16_OFFSET", 0x40 );
|
||||||
|
PRINT_IT( "R17_OFFSET", 0x44 );
|
||||||
|
PRINT_IT( "R18_OFFSET", 0x48 );
|
||||||
|
PRINT_IT( "R19_OFFSET", 0x4c );
|
||||||
|
PRINT_IT( "R20_OFFSET", 0x50 );
|
||||||
|
PRINT_IT( "R21_OFFSET", 0x54 );
|
||||||
|
PRINT_IT( "R22_OFFSET", 0x58 );
|
||||||
|
PRINT_IT( "R23_OFFSET", 0x5c );
|
||||||
|
PRINT_IT( "R24_OFFSET", 0x60 );
|
||||||
|
PRINT_IT( "R25_OFFSET", 0x64 );
|
||||||
|
PRINT_IT( "R26_OFFSET", 0x68 );
|
||||||
|
PRINT_IT( "R27_OFFSET", 0x6c );
|
||||||
|
PRINT_IT( "R28_OFFSET", 0x70 );
|
||||||
|
PRINT_IT( "R29_OFFSET", 0x74 );
|
||||||
|
PRINT_IT( "R30_OFFSET", 0x78 );
|
||||||
|
PRINT_IT( "R31_OFFSET", 0x7c );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* And common aliases for the above
|
||||||
|
*/
|
||||||
|
|
||||||
|
PRINT_COMMENT("Common aliases for above");
|
||||||
|
|
||||||
|
PRINT_IT( "RP_OFFSET", 0x08 );
|
||||||
|
PRINT_IT( "ARG3_OFFSET", 0x5c );
|
||||||
|
PRINT_IT( "ARG2_OFFSET", 0x60 );
|
||||||
|
PRINT_IT( "ARG1_OFFSET", 0x64 );
|
||||||
|
PRINT_IT( "ARG0_OFFSET", 0x68 );
|
||||||
|
PRINT_IT( "SP_OFFSET", 0x78 );
|
||||||
|
PRINT_IT( "DP_OFFSET", 0x6c );
|
||||||
|
PRINT_IT( "RET0_OFFSET", 0x74 );
|
||||||
|
PRINT_IT( "RET1_OFFSET", 0x74 );
|
||||||
|
|
||||||
|
PRINT_SIZE("CPU_CONTEXT_SIZE", 168 );
|
||||||
|
|
||||||
|
PRINT_COMMENT("Context_Control_fp information");
|
||||||
|
|
||||||
|
PRINT_SIZE("CPU_CONTEXT_FP_SIZE", 256);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* And the control registers
|
||||||
|
*/
|
||||||
|
|
||||||
|
PRINT_COMMENT("Control register portion of context");
|
||||||
|
|
||||||
|
PRINT_IT( "SAR_OFFSET", 0x80 );
|
||||||
|
PRINT_IT( "IPSW_OFFSET", 0x84 );
|
||||||
|
PRINT_IT( "IIR_OFFSET", 0x88 );
|
||||||
|
PRINT_IT( "IOR_OFFSET", 0x8c );
|
||||||
|
PRINT_IT( "ISR_OFFSET", 0x90 );
|
||||||
|
PRINT_IT( "PCOQFRONT_OFFSET", 0x94 );
|
||||||
|
PRINT_IT( "PCOQBACK_OFFSET", 0x98 );
|
||||||
|
PRINT_IT( "PCSQFRONT_OFFSET", 0x9c );
|
||||||
|
PRINT_IT( "PCSQBACK_OFFSET", 0xa0 );
|
||||||
|
PRINT_IT( "ITIMER_OFFSET", 0xa4 );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Full interrupt frame (integer + float)
|
||||||
|
*/
|
||||||
|
|
||||||
|
PRINT_COMMENT("Interrupt frame information");
|
||||||
|
|
||||||
|
PRINT_IT( "INTEGER_CONTEXT_OFFSET", 0x00 );
|
||||||
|
PRINT_IT( "FP_CONTEXT_OFFSET", 0xa8 );
|
||||||
|
PRINT_SIZE( "CPU_INTERRUPT_FRAME_SIZE", 448 );
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -119,10 +119,19 @@ libc_switch_hook(rtems_tcb *current_task,
|
|||||||
/* XXX We can't use rtems_task_set_note() here since SYSI task has a
|
/* XXX We can't use rtems_task_set_note() here since SYSI task has a
|
||||||
* tid of 0, which is treated specially (optimized, actually)
|
* tid of 0, which is treated specially (optimized, actually)
|
||||||
* by rtems_task_set_note
|
* by rtems_task_set_note
|
||||||
|
*
|
||||||
|
* NOTE: The above comment is no longer true and we need to use
|
||||||
|
* the extension data areas added about the same time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Don't touch the outgoing task if it has been deleted.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( !_States_Is_transient( current_task->current_state ) ) {
|
||||||
impure_value = (rtems_unsigned32) _REENT;
|
impure_value = (rtems_unsigned32) _REENT;
|
||||||
MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
|
MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
|
||||||
|
}
|
||||||
|
|
||||||
_REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
|
_REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
|
||||||
|
|
||||||
@@ -171,7 +180,8 @@ libc_delete_hook(rtems_tcb *current_task,
|
|||||||
ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
|
ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ptr)
|
/* if (ptr) */
|
||||||
|
if (ptr && ptr != &libc_global_reent)
|
||||||
{
|
{
|
||||||
_wrapup_reent(ptr);
|
_wrapup_reent(ptr);
|
||||||
_reclaim_reent(ptr);
|
_reclaim_reent(ptr);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ void MY_task_set_note(
|
|||||||
|
|
||||||
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
|
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
|
||||||
|
|
||||||
|
if ( api )
|
||||||
api->Notepads[ notepad ] = note;
|
api->Notepads[ notepad ] = note;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,10 +119,19 @@ libc_switch_hook(rtems_tcb *current_task,
|
|||||||
/* XXX We can't use rtems_task_set_note() here since SYSI task has a
|
/* XXX We can't use rtems_task_set_note() here since SYSI task has a
|
||||||
* tid of 0, which is treated specially (optimized, actually)
|
* tid of 0, which is treated specially (optimized, actually)
|
||||||
* by rtems_task_set_note
|
* by rtems_task_set_note
|
||||||
|
*
|
||||||
|
* NOTE: The above comment is no longer true and we need to use
|
||||||
|
* the extension data areas added about the same time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Don't touch the outgoing task if it has been deleted.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( !_States_Is_transient( current_task->current_state ) ) {
|
||||||
impure_value = (rtems_unsigned32) _REENT;
|
impure_value = (rtems_unsigned32) _REENT;
|
||||||
MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
|
MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
|
||||||
|
}
|
||||||
|
|
||||||
_REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
|
_REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
|
||||||
|
|
||||||
@@ -171,7 +180,8 @@ libc_delete_hook(rtems_tcb *current_task,
|
|||||||
ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
|
ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ptr)
|
/* if (ptr) */
|
||||||
|
if (ptr && ptr != &libc_global_reent)
|
||||||
{
|
{
|
||||||
_wrapup_reent(ptr);
|
_wrapup_reent(ptr);
|
||||||
_reclaim_reent(ptr);
|
_reclaim_reent(ptr);
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ void hppa_external_interrupt(unsigned32, CPU_Interrupt_frame *);
|
|||||||
* So we use our own prototype instead of rtems_isr_entry
|
* So we use our own prototype instead of rtems_isr_entry
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef rtems_isr ( *hppa_rtems_isr_entry )(
|
typedef void ( *hppa_rtems_isr_entry )(
|
||||||
rtems_vector_number,
|
ISR_Vector_number,
|
||||||
CPU_Interrupt_frame *
|
CPU_Interrupt_frame *
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ void _CPU_ISR_install_vector(
|
|||||||
void
|
void
|
||||||
hppa_external_interrupt_initialize(void)
|
hppa_external_interrupt_initialize(void)
|
||||||
{
|
{
|
||||||
rtems_isr_entry ignore;
|
hppa_rtems_isr_entry ignore;
|
||||||
|
|
||||||
/* mark them all unused */
|
/* mark them all unused */
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ void _MPCI_Handler_initialization(
|
|||||||
THREAD_QUEUE_DISCIPLINE_FIFO,
|
THREAD_QUEUE_DISCIPLINE_FIFO,
|
||||||
STATES_WAITING_FOR_RPC_REPLY,
|
STATES_WAITING_FOR_RPC_REPLY,
|
||||||
NULL,
|
NULL,
|
||||||
RTEMS_TIMEOUT
|
RTEMS_TIMEOUT /* XXX */
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -471,6 +471,9 @@ void _Thread_Close(
|
|||||||
|
|
||||||
if ( the_thread->extensions )
|
if ( the_thread->extensions )
|
||||||
(void) _Workspace_Free( the_thread->extensions );
|
(void) _Workspace_Free( the_thread->extensions );
|
||||||
|
|
||||||
|
the_thread->Start.stack = NULL;
|
||||||
|
the_thread->extensions = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
|
|||||||
@@ -24,12 +24,14 @@
|
|||||||
|
|
||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
|
|
||||||
|
void print_information( void );
|
||||||
|
|
||||||
int main(
|
int main(
|
||||||
int argc,
|
int argc,
|
||||||
char **argv
|
char **argv
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
unsigned int size;
|
unsigned int size = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print the file header
|
* Print the file header
|
||||||
@@ -59,10 +61,6 @@ printf(
|
|||||||
"\n"
|
"\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
* Offsets of elements in the Context_control structure.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define PRINT_IT( STRING, TYPE, FIELD ) \
|
#define PRINT_IT( STRING, TYPE, FIELD ) \
|
||||||
printf( "#define\t%s\t0x%p\t\t/* %d */\n", \
|
printf( "#define\t%s\t0x%p\t\t/* %d */\n", \
|
||||||
STRING, \
|
STRING, \
|
||||||
@@ -84,6 +82,12 @@ printf(
|
|||||||
"\n" \
|
"\n" \
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#if defined(hpux) && defined(__hppa__)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Offsets of elements in the Context_control structure.
|
||||||
|
*/
|
||||||
|
|
||||||
PRINT_COMMENT("Context_Control information");
|
PRINT_COMMENT("Context_Control information");
|
||||||
|
|
||||||
PRINT_IT( "FLAGS_OFFSET", Context_Control *, flags );
|
PRINT_IT( "FLAGS_OFFSET", Context_Control *, flags );
|
||||||
@@ -172,6 +176,12 @@ printf(
|
|||||||
|
|
||||||
printf( "#define\tCPU_INTERRUPT_FRAME_SIZE\t%d\t\t/* 0x%x */\n", size, size );
|
printf( "#define\tCPU_INTERRUPT_FRAME_SIZE\t%d\t\t/* 0x%x */\n", size, size );
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
print_information();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef PRINT_IT
|
#undef PRINT_IT
|
||||||
#undef PRINT_SIZE
|
#undef PRINT_SIZE
|
||||||
#undef PRINT_COMMENT
|
#undef PRINT_COMMENT
|
||||||
@@ -189,3 +199,117 @@ printf(
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void print_information( void )
|
||||||
|
{
|
||||||
|
|
||||||
|
#define PRINT_IT( STRING, NUMBER ) \
|
||||||
|
printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
|
||||||
|
STRING, \
|
||||||
|
NUMBER, \
|
||||||
|
NUMBER );
|
||||||
|
|
||||||
|
#define PRINT_SIZE( STRING, NUMBER ) \
|
||||||
|
printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
|
||||||
|
STRING, \
|
||||||
|
NUMBER, \
|
||||||
|
NUMBER );
|
||||||
|
|
||||||
|
#define PRINT_COMMENT( STRING ) \
|
||||||
|
printf( \
|
||||||
|
"\n" \
|
||||||
|
"/*\n" \
|
||||||
|
" * " STRING "\n" \
|
||||||
|
" */\n" \
|
||||||
|
"\n" \
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Offsets of elements in the Context_control structure.
|
||||||
|
*/
|
||||||
|
|
||||||
|
PRINT_COMMENT("Context_Control information");
|
||||||
|
|
||||||
|
PRINT_IT( "FLAGS_OFFSET", 0x00 );
|
||||||
|
PRINT_IT( "R1_OFFSET", 0x04 );
|
||||||
|
PRINT_IT( "R2_OFFSET", 0x08 );
|
||||||
|
PRINT_IT( "R3_OFFSET", 0x0c );
|
||||||
|
PRINT_IT( "R4_OFFSET", 0x00 );
|
||||||
|
PRINT_IT( "R5_OFFSET", 0x14 );
|
||||||
|
PRINT_IT( "R6_OFFSET", 0x18 );
|
||||||
|
PRINT_IT( "R7_OFFSET", 0x1c );
|
||||||
|
PRINT_IT( "R8_OFFSET", 0x20 );
|
||||||
|
PRINT_IT( "R9_OFFSET", 0x24 );
|
||||||
|
PRINT_IT( "R10_OFFSET", 0x28 );
|
||||||
|
PRINT_IT( "R11_OFFSET", 0x2c );
|
||||||
|
PRINT_IT( "R12_OFFSET", 0x30 );
|
||||||
|
PRINT_IT( "R13_OFFSET", 0x34 );
|
||||||
|
PRINT_IT( "R14_OFFSET", 0x38 );
|
||||||
|
PRINT_IT( "R15_OFFSET", 0x3c );
|
||||||
|
PRINT_IT( "R16_OFFSET", 0x40 );
|
||||||
|
PRINT_IT( "R17_OFFSET", 0x44 );
|
||||||
|
PRINT_IT( "R18_OFFSET", 0x48 );
|
||||||
|
PRINT_IT( "R19_OFFSET", 0x4c );
|
||||||
|
PRINT_IT( "R20_OFFSET", 0x50 );
|
||||||
|
PRINT_IT( "R21_OFFSET", 0x54 );
|
||||||
|
PRINT_IT( "R22_OFFSET", 0x58 );
|
||||||
|
PRINT_IT( "R23_OFFSET", 0x5c );
|
||||||
|
PRINT_IT( "R24_OFFSET", 0x60 );
|
||||||
|
PRINT_IT( "R25_OFFSET", 0x64 );
|
||||||
|
PRINT_IT( "R26_OFFSET", 0x68 );
|
||||||
|
PRINT_IT( "R27_OFFSET", 0x6c );
|
||||||
|
PRINT_IT( "R28_OFFSET", 0x70 );
|
||||||
|
PRINT_IT( "R29_OFFSET", 0x74 );
|
||||||
|
PRINT_IT( "R30_OFFSET", 0x78 );
|
||||||
|
PRINT_IT( "R31_OFFSET", 0x7c );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* And common aliases for the above
|
||||||
|
*/
|
||||||
|
|
||||||
|
PRINT_COMMENT("Common aliases for above");
|
||||||
|
|
||||||
|
PRINT_IT( "RP_OFFSET", 0x08 );
|
||||||
|
PRINT_IT( "ARG3_OFFSET", 0x5c );
|
||||||
|
PRINT_IT( "ARG2_OFFSET", 0x60 );
|
||||||
|
PRINT_IT( "ARG1_OFFSET", 0x64 );
|
||||||
|
PRINT_IT( "ARG0_OFFSET", 0x68 );
|
||||||
|
PRINT_IT( "SP_OFFSET", 0x78 );
|
||||||
|
PRINT_IT( "DP_OFFSET", 0x6c );
|
||||||
|
PRINT_IT( "RET0_OFFSET", 0x74 );
|
||||||
|
PRINT_IT( "RET1_OFFSET", 0x74 );
|
||||||
|
|
||||||
|
PRINT_SIZE("CPU_CONTEXT_SIZE", 168 );
|
||||||
|
|
||||||
|
PRINT_COMMENT("Context_Control_fp information");
|
||||||
|
|
||||||
|
PRINT_SIZE("CPU_CONTEXT_FP_SIZE", 256);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* And the control registers
|
||||||
|
*/
|
||||||
|
|
||||||
|
PRINT_COMMENT("Control register portion of context");
|
||||||
|
|
||||||
|
PRINT_IT( "SAR_OFFSET", 0x80 );
|
||||||
|
PRINT_IT( "IPSW_OFFSET", 0x84 );
|
||||||
|
PRINT_IT( "IIR_OFFSET", 0x88 );
|
||||||
|
PRINT_IT( "IOR_OFFSET", 0x8c );
|
||||||
|
PRINT_IT( "ISR_OFFSET", 0x90 );
|
||||||
|
PRINT_IT( "PCOQFRONT_OFFSET", 0x94 );
|
||||||
|
PRINT_IT( "PCOQBACK_OFFSET", 0x98 );
|
||||||
|
PRINT_IT( "PCSQFRONT_OFFSET", 0x9c );
|
||||||
|
PRINT_IT( "PCSQBACK_OFFSET", 0xa0 );
|
||||||
|
PRINT_IT( "ITIMER_OFFSET", 0xa4 );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Full interrupt frame (integer + float)
|
||||||
|
*/
|
||||||
|
|
||||||
|
PRINT_COMMENT("Interrupt frame information");
|
||||||
|
|
||||||
|
PRINT_IT( "INTEGER_CONTEXT_OFFSET", 0x00 );
|
||||||
|
PRINT_IT( "FP_CONTEXT_OFFSET", 0xa8 );
|
||||||
|
PRINT_SIZE( "CPU_INTERRUPT_FRAME_SIZE", 448 );
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user