Changeset b3ac6a8d in rtems for tools/cpu/hppa1.1


Ignore:
Timestamp:
09/12/95 19:45:42 (28 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
3652ad35
Parents:
4b61ebfb
Message:

Initial attempt at building HP PA-RISC using Solaris hosted tools.

Changed back to Newlib for Solaris UNIX simulator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/cpu/hppa1.1/genoffsets.c

    r4b61ebfb rb3ac6a8d  
    2424
    2525#include <rtems/system.h>
     26
     27void print_information( void );
    2628
    2729int main(
     
    3032)
    3133{
    32   unsigned int size;
     34  unsigned int size = 0;
    3335
    3436  /*
     
    6062);
    6163
    62 /*
    63  *  Offsets of elements in the Context_control structure.
    64  */
    65 
    6664#define PRINT_IT( STRING, TYPE, FIELD ) \
    6765  printf( "#define\t%s\t0x%p\t\t/* %d */\n", \
     
    8482    "\n"        \
    8583  );
     84
     85#if defined(hpux) && defined(__hppa__)
     86
     87/*
     88 *  Offsets of elements in the Context_control structure.
     89 */
    8690
    8791  PRINT_COMMENT("Context_Control information");
     
    173177  printf( "#define\tCPU_INTERRUPT_FRAME_SIZE\t%d\t\t/* 0x%x */\n", size, size );
    174178
     179#else
     180
     181  print_information();
     182
     183#endif
     184
    175185#undef PRINT_IT
    176186#undef PRINT_SIZE
     
    190200  return 0;
    191201}
     202
     203void print_information( void )
     204{
     205
     206#define PRINT_IT( STRING, NUMBER ) \
     207  printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
     208          STRING, \
     209          NUMBER, \
     210          NUMBER );
     211
     212#define PRINT_SIZE( STRING, NUMBER ) \
     213  printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
     214          STRING, \
     215          NUMBER, \
     216          NUMBER );
     217
     218#define PRINT_COMMENT( STRING ) \
     219  printf(       \
     220    "\n"        \
     221    "/*\n"      \
     222    " * " STRING "\n" \
     223    " */\n"     \
     224    "\n"        \
     225  );
     226
     227/*
     228 *  Offsets of elements in the Context_control structure.
     229 */
     230
     231  PRINT_COMMENT("Context_Control information");
     232
     233  PRINT_IT( "FLAGS_OFFSET",  0x00 );
     234  PRINT_IT( "R1_OFFSET",     0x04 );
     235  PRINT_IT( "R2_OFFSET",     0x08 );
     236  PRINT_IT( "R3_OFFSET",     0x0c );
     237  PRINT_IT( "R4_OFFSET",     0x00 );
     238  PRINT_IT( "R5_OFFSET",     0x14 );
     239  PRINT_IT( "R6_OFFSET",     0x18 );
     240  PRINT_IT( "R7_OFFSET",     0x1c );
     241  PRINT_IT( "R8_OFFSET",     0x20 );
     242  PRINT_IT( "R9_OFFSET",     0x24 );
     243  PRINT_IT( "R10_OFFSET",    0x28 );
     244  PRINT_IT( "R11_OFFSET",    0x2c );
     245  PRINT_IT( "R12_OFFSET",    0x30 );
     246  PRINT_IT( "R13_OFFSET",    0x34 );
     247  PRINT_IT( "R14_OFFSET",    0x38 );
     248  PRINT_IT( "R15_OFFSET",    0x3c );
     249  PRINT_IT( "R16_OFFSET",    0x40 );
     250  PRINT_IT( "R17_OFFSET",    0x44 );
     251  PRINT_IT( "R18_OFFSET",    0x48 );
     252  PRINT_IT( "R19_OFFSET",    0x4c );
     253  PRINT_IT( "R20_OFFSET",    0x50 );
     254  PRINT_IT( "R21_OFFSET",    0x54 );
     255  PRINT_IT( "R22_OFFSET",    0x58 );
     256  PRINT_IT( "R23_OFFSET",    0x5c );
     257  PRINT_IT( "R24_OFFSET",    0x60 );
     258  PRINT_IT( "R25_OFFSET",    0x64 );
     259  PRINT_IT( "R26_OFFSET",    0x68 );
     260  PRINT_IT( "R27_OFFSET",    0x6c );
     261  PRINT_IT( "R28_OFFSET",    0x70 );
     262  PRINT_IT( "R29_OFFSET",    0x74 );
     263  PRINT_IT( "R30_OFFSET",    0x78 );
     264  PRINT_IT( "R31_OFFSET",    0x7c );
     265
     266  /*
     267   * And common aliases for the above
     268   */
     269
     270  PRINT_COMMENT("Common aliases for above");
     271
     272  PRINT_IT( "RP_OFFSET",   0x08 );
     273  PRINT_IT( "ARG3_OFFSET", 0x5c );
     274  PRINT_IT( "ARG2_OFFSET", 0x60 );
     275  PRINT_IT( "ARG1_OFFSET", 0x64 );
     276  PRINT_IT( "ARG0_OFFSET", 0x68 );
     277  PRINT_IT( "SP_OFFSET",   0x78 );
     278  PRINT_IT( "DP_OFFSET",   0x6c );
     279  PRINT_IT( "RET0_OFFSET", 0x74 );
     280  PRINT_IT( "RET1_OFFSET", 0x74 );
     281
     282  PRINT_SIZE("CPU_CONTEXT_SIZE", 168 );
     283
     284  PRINT_COMMENT("Context_Control_fp information");
     285
     286  PRINT_SIZE("CPU_CONTEXT_FP_SIZE", 256);
     287
     288  /*
     289   *  And the control registers
     290   */
     291
     292  PRINT_COMMENT("Control register portion of context");
     293
     294  PRINT_IT( "SAR_OFFSET",        0x80 );
     295  PRINT_IT( "IPSW_OFFSET",       0x84 );
     296  PRINT_IT( "IIR_OFFSET",        0x88 );
     297  PRINT_IT( "IOR_OFFSET",        0x8c );
     298  PRINT_IT( "ISR_OFFSET",        0x90 );
     299  PRINT_IT( "PCOQFRONT_OFFSET",  0x94 );
     300  PRINT_IT( "PCOQBACK_OFFSET",   0x98 );
     301  PRINT_IT( "PCSQFRONT_OFFSET",  0x9c );
     302  PRINT_IT( "PCSQBACK_OFFSET",   0xa0 );
     303  PRINT_IT( "ITIMER_OFFSET",     0xa4 );
     304
     305  /*
     306   *  Full interrupt frame (integer + float)
     307   */
     308
     309  PRINT_COMMENT("Interrupt frame information");
     310
     311  PRINT_IT( "INTEGER_CONTEXT_OFFSET",   0x00 );
     312  PRINT_IT( "FP_CONTEXT_OFFSET",        0xa8 );
     313  PRINT_SIZE( "CPU_INTERRUPT_FRAME_SIZE", 448 );
     314
     315}
Note: See TracChangeset for help on using the changeset viewer.