source: trunk/libs/newlib/src/libgloss/or1k/or1k-internals.h @ 529

Last change on this file since 529 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.7 KB
Line 
1#ifndef __OR1K_INTERNAL_H__
2#define __OR1K_INTERNAL_H__
3
4#include <stdint.h>
5#include <string.h>
6
7#include "include/or1k-support.h"
8
9extern uint8_t* _or1k_stack_top;
10extern size_t _or1k_stack_size;
11extern uint8_t* _or1k_stack_bottom;
12
13extern uint8_t* _or1k_exception_stack_top;
14extern size_t _or1k_exception_stack_size;
15extern uint8_t* _or1k_exception_stack_bottom;
16
17#ifdef __OR1K_MULTICORE__
18extern uint8_t* *_or1k_stack_core;
19extern uint8_t* *_or1k_exception_stack_core;
20#endif
21
22
23// The first two vectors are not used (address 0 and reset)
24#define OR1K_NUM_EXCEPTIONS 30
25
26typedef or1k_exception_handler_fptr or1k_exception_handler_table_t[OR1K_NUM_EXCEPTIONS];
27
28#ifdef __OR1K_MULTICORE__
29extern or1k_exception_handler_table_t *_or1k_exception_handler_table;
30#else
31extern or1k_exception_handler_table_t _or1k_exception_handler_table;
32#endif
33
34typedef or1k_interrupt_handler_fptr or1k_interrupt_handler_table_t[32];
35typedef void* or1k_interrupt_handler_data_ptr_table_t[32];
36
37#ifdef __OR1K_MULTICORE__
38extern or1k_interrupt_handler_table_t *_or1k_interrupt_handler_table;
39extern or1k_interrupt_handler_data_ptr_table_t *_or1k_interrupt_handler_data_ptr_table;
40#else
41extern or1k_interrupt_handler_table_t _or1k_interrupt_handler_table;
42extern or1k_interrupt_handler_data_ptr_table_t _or1k_interrupt_handler_data_ptr_table;
43#endif
44
45extern void _or1k_interrupt_handler(void);
46
47struct _or1k_reent {
48        /* Tick timer variable */
49        volatile uint32_t or1k_timer_ticks;
50
51        /* Tick rate storage */
52        uint32_t or1k_timer_period;
53        uint32_t or1k_timer_mode;
54};
55
56
57#ifdef __OR1K_MULTICORE__
58extern struct _or1k_reent (*_or1k_reent)[];
59#define OR1K_REENT (*_or1k_reent)[or1k_coreid()]
60#else
61extern struct _or1k_reent _or1k_reent;
62#define OR1K_REENT _or1k_reent
63#endif
64
65extern void _or1k_reent_init();
66
67#endif
Note: See TracBrowser for help on using the repository browser.