source: rtems/c/src/lib/libbsp/sparc64/shared/start/trap_table.S @ 722c0fd

4.115
Last change on this file since 722c0fd was 722c0fd, checked in by Joel Sherrill <joel.sherrill@…>, on 11/16/10 at 23:20:08

2010-11-15 Gedare Bloom <giddyup44@…>

PR 1691/bsps

  • shared/include/traptable.h, shared/start/trap_table.S, shared/startup/linkcmds: Create a dummy trap table that jumps to the firmware trap table for default trap handlers.
  • Property mode set to 100644
File size: 6.5 KB
Line 
1/*
2 * trap_table.S
3 *
4 * trap code for Sparc64 RTEMS.
5 *
6 *  COPYRIGHT (c) 2010 Gedare Bloom.
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  This code defines the space for the trap table used by sun4u.
13 *
14 * $Id$
15 */
16
17#include <rtems/asm.h>
18#include <rtems/score/cpu.h>
19#include <traptable.h>
20
21.register %g2, #scratch
22
23.macro JUMP_TO_TRAP offset
24  sethi %hi(real_trap_table), %g1;
25  sethi %hi(\offset), %g2;
26  or    %g1, %lo(real_trap_table), %g1;
27  or    %g2, %lo(\offset), %g2;          ! g2 = offset
28  ldx   [%g1], %g1;                      ! g1 = real_trap_table
29  add   %g1, %g2, %g1;                   ! g1 = real_trap_table[offset]
30  jmpl  %g1, %g0;
31  nop;
32.endm
33
34! space to save a pointer to the real trap table
35.section  .data
36  .align 8
37  .global real_trap_table
38  SYM(real_trap_table):
39  .space 8
40
41.section .text
42  .align (TABLE_SIZE)
43PUBLIC(trap_table)
44  SYM(trap_table):
45
46  .irp idx, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \
47    11, 12, 13, 14, 15, 16, 17, 18, 19, 20, \
48    21, 22, 23, 24, 25, 26, 27, 28, 29, 30, \
49    31, 32, 33, 34, 35, 36, 37, 38, 39, 40, \
50    41, 42, 43, 44, 45, 46, 47, 48, 49, 50, \
51    51, 52, 53, 54, 55, 56, 57, 58, 59, 60, \
52    61, 62, 63, 64, 65, 66, 67, 68, 69, 70, \
53    71, 72, 73, 74, 75, 76, 77, 78, 79, 80, \
54    81, 82, 83, 84, 85, 86, 87, 88, 89, 90, \
55    91, 92, 93, 94, 95, 96, 97, 98, 99, 100, \
56    101, 102, 103, 104, 105, 106, 107, 108, 109, 110, \
57    111, 112, 113, 114, 115, 116, 117, 118, 119, 120, \
58    121, 122, 123, 124, 125, 126, 127, 128, 129, 130, \
59    131, 132, 133, 134, 135, 136, 137, 138, 139, 140, \
60    141, 142, 143, 144, 145, 146, 147, 148, 149, 150, \
61    151, 152, 153, 154, 155, 156, 157, 158, 159, 160, \
62    161, 162, 163, 164, 165, 166, 167, 168, 169, 170, \
63    171, 172, 173, 174, 175, 176, 177, 178, 179, 180, \
64    181, 182, 183, 184, 185, 186, 187, 188, 189, 190, \
65    191, 192, 193, 194, 195, 196, 197, 198, 199, 200, \
66    201, 202, 203, 204, 205, 206, 207, 208, 209, 210, \
67    211, 212, 213, 214, 215, 216, 217, 218, 219, 220, \
68    221, 222, 223, 224, 225, 226, 227, 228, 229, 230, \
69    231, 232, 233, 234, 235, 236, 237, 238, 239, 240, \
70    241, 242, 243, 244, 245, 246, 247, 248, 249, 250, \
71    251, 252, 253, 254, 255, 256, 257, 258, 259, 260, \
72    261, 262, 263, 264, 265, 266, 267, 268, 269, 270, \
73    271, 272, 273, 274, 275, 276, 277, 278, 279, 280, \
74    281, 282, 283, 284, 285, 286, 287, 288, 289, 290, \
75    291, 292, 293, 294, 295, 296, 297, 298, 299, 300, \
76    301, 302, 303, 304, 305, 306, 307, 308, 309, 310, \
77    311, 312, 313, 314, 315, 316, 317, 318, 319, 320, \
78    321, 322, 323, 324, 325, 326, 327, 328, 329, 330, \
79    331, 332, 333, 334, 335, 336, 337, 338, 339, 340, \
80    341, 342, 343, 344, 345, 346, 347, 348, 349, 350, \
81    351, 352, 353, 354, 355, 356, 357, 358, 359, 360, \
82    361, 362, 363, 364, 365, 366, 367, 368, 369, 370, \
83    371, 372, 373, 374, 375, 376, 377, 378, 379, 380, \
84    381, 382, 383, 384, 385, 386, 387, 388, 389, 390, \
85    391, 392, 393, 394, 395, 396, 397, 398, 399, 400, \
86    401, 402, 403, 404, 405, 406, 407, 408, 409, 410, \
87    411, 412, 413, 414, 415, 416, 417, 418, 419, 420, \
88    421, 422, 423, 424, 425, 426, 427, 428, 429, 430, \
89    431, 432, 433, 434, 435, 436, 437, 438, 439, 440, \
90    441, 442, 443, 444, 445, 446, 447, 448, 449, 450, \
91    451, 452, 453, 454, 455, 456, 457, 458, 459, 460, \
92    461, 462, 463, 464, 465, 466, 467, 468, 469, 470, \
93    471, 472, 473, 474, 475, 476, 477, 478, 479, 480, \
94    481, 482, 483, 484, 485, 486, 487, 488, 489, 490, \
95    491, 492, 493, 494, 495, 496, 497, 498, 499, 500, \
96    501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511
97
98    .org trap_table + ((\idx)*32)
99      JUMP_TO_TRAP( ((\idx)*32) );
100  .endr
101
102  .irp idx, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, \
103    11, 12, 13, 14, 15, 16, 17, 18, 19, 20, \
104    21, 22, 23, 24, 25, 26, 27, 28, 29, 30, \
105    31, 32, 33, 34, 35, 36, 37, 38, 39, 40, \
106    41, 42, 43, 44, 45, 46, 47, 48, 49, 50, \
107    51, 52, 53, 54, 55, 56, 57, 58, 59, 60, \
108    61, 62, 63, 64, 65, 66, 67, 68, 69, 70, \
109    71, 72, 73, 74, 75, 76, 77, 78, 79, 80, \
110    81, 82, 83, 84, 85, 86, 87, 88, 89, 90, \
111    91, 92, 93, 94, 95, 96, 97, 98, 99, 100, \
112    101, 102, 103, 104, 105, 106, 107, 108, 109, 110, \
113    111, 112, 113, 114, 115, 116, 117, 118, 119, 120, \
114    121, 122, 123, 124, 125, 126, 127, 128, 129, 130, \
115    131, 132, 133, 134, 135, 136, 137, 138, 139, 140, \
116    141, 142, 143, 144, 145, 146, 147, 148, 149, 150, \
117    151, 152, 153, 154, 155, 156, 157, 158, 159, 160, \
118    161, 162, 163, 164, 165, 166, 167, 168, 169, 170, \
119    171, 172, 173, 174, 175, 176, 177, 178, 179, 180, \
120    181, 182, 183, 184, 185, 186, 187, 188, 189, 190, \
121    191, 192, 193, 194, 195, 196, 197, 198, 199, 200, \
122    201, 202, 203, 204, 205, 206, 207, 208, 209, 210, \
123    211, 212, 213, 214, 215, 216, 217, 218, 219, 220, \
124    221, 222, 223, 224, 225, 226, 227, 228, 229, 230, \
125    231, 232, 233, 234, 235, 236, 237, 238, 239, 240, \
126    241, 242, 243, 244, 245, 246, 247, 248, 249, 250, \
127    251, 252, 253, 254, 255, 256, 257, 258, 259, 260, \
128    261, 262, 263, 264, 265, 266, 267, 268, 269, 270, \
129    271, 272, 273, 274, 275, 276, 277, 278, 279, 280, \
130    281, 282, 283, 284, 285, 286, 287, 288, 289, 290, \
131    291, 292, 293, 294, 295, 296, 297, 298, 299, 300, \
132    301, 302, 303, 304, 305, 306, 307, 308, 309, 310, \
133    311, 312, 313, 314, 315, 316, 317, 318, 319, 320, \
134    321, 322, 323, 324, 325, 326, 327, 328, 329, 330, \
135    331, 332, 333, 334, 335, 336, 337, 338, 339, 340, \
136    341, 342, 343, 344, 345, 346, 347, 348, 349, 350, \
137    351, 352, 353, 354, 355, 356, 357, 358, 359, 360, \
138    361, 362, 363, 364, 365, 366, 367, 368, 369, 370, \
139    371, 372, 373, 374, 375, 376, 377, 378, 379, 380, \
140    381, 382, 383, 384, 385, 386, 387, 388, 389, 390, \
141    391, 392, 393, 394, 395, 396, 397, 398, 399, 400, \
142    401, 402, 403, 404, 405, 406, 407, 408, 409, 410, \
143    411, 412, 413, 414, 415, 416, 417, 418, 419, 420, \
144    421, 422, 423, 424, 425, 426, 427, 428, 429, 430, \
145    431, 432, 433, 434, 435, 436, 437, 438, 439, 440, \
146    441, 442, 443, 444, 445, 446, 447, 448, 449, 450, \
147    451, 452, 453, 454, 455, 456, 457, 458, 459, 460, \
148    461, 462, 463, 464, 465, 466, 467, 468, 469, 470, \
149    471, 472, 473, 474, 475, 476, 477, 478, 479, 480, \
150    481, 482, 483, 484, 485, 486, 487, 488, 489, 490, \
151    491, 492, 493, 494, 495, 496, 497, 498, 499, 500, \
152    501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511
153
154    .org trap_table + 512*32 + ((\idx)*32)
155      JUMP_TO_TRAP( 512*32 + ((\idx)*32) );
156  .endr
157
Note: See TracBrowser for help on using the repository browser.