OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [ecos-2.0/] [packages/] [hal/] [calmrisc16/] [arch/] [v2_0/] [include/] [calm16-stub.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1254 phoenix
#ifndef CYGONCE_HAL_MIPS_STUB_H
2
#define CYGONCE_HAL_MIPS_STUB_H
3
//========================================================================
4
//
5
//      mips-stub.h
6
//
7
//      CalmRISC16-specific definitions for generic stub
8
//
9
//========================================================================
10
//####ECOSGPLCOPYRIGHTBEGIN####
11
// -------------------------------------------
12
// This file is part of eCos, the Embedded Configurable Operating System.
13
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14
//
15
// eCos is free software; you can redistribute it and/or modify it under
16
// the terms of the GNU General Public License as published by the Free
17
// Software Foundation; either version 2 or (at your option) any later version.
18
//
19
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
21
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22
// for more details.
23
//
24
// You should have received a copy of the GNU General Public License along
25
// with eCos; if not, write to the Free Software Foundation, Inc.,
26
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27
//
28
// As a special exception, if other files instantiate templates or use macros
29
// or inline functions from this file, or you compile this file and link it
30
// with other works to produce a work based on this file, this file does not
31
// by itself cause the resulting work to be covered by the GNU General Public
32
// License. However the source code for this file must still be made available
33
// in accordance with section (3) of the GNU General Public License.
34
//
35
// This exception does not invalidate any other reasons why a work based on
36
// this file might be covered by the GNU General Public License.
37
//
38
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39
// at http://sources.redhat.com/ecos/ecos-license/
40
// -------------------------------------------
41
//####ECOSGPLCOPYRIGHTEND####
42
//========================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):     Red Hat, msalter
46
// Contributors:  Red Hat, msalter
47
// Date:          2001-02-12
48
// Purpose:       
49
// Description:   CalmRISC16-specific definitions for generic stub
50
// Usage:         
51
//
52
//####DESCRIPTIONEND####
53
//
54
//========================================================================
55
 
56
 
57
#include <pkgconf/system.h>
58
 
59
#include <cyg/hal/hal_io.h>
60
 
61
#ifdef __cplusplus
62
extern "C" {
63
#endif
64
 
65
#define TARGET_HAS_HARVARD_MEMORY 1
66
typedef unsigned long target_addr_t;
67
#define TARGET_ADDR_IS_PROGMEM(x) (((unsigned long)(x)) >= 0x400000UL)
68
#define TARGET_ADDR_TO_PTR(x)     ((char *) (((unsigned long)(x)) & 0x3fffff))
69
 
70
#define NUMREGS    39
71
 
72
typedef unsigned long target_register_t;
73
 
74
enum regnames {
75
        REG_R0,   REG_R1,   REG_R2,   REG_R3,   REG_R4,   REG_R5,   REG_R6,   REG_R7,
76
        REG_R8,   REG_R9,   REG_R10,  REG_R11,  REG_R12,  REG_R13,  REG_R14,  REG_R15,
77
        REG_E8,   REG_E9,   REG_E10,  REG_E11,  REG_E12,  REG_E13,  REG_E14,  REG_E15,
78
        REG_A8,   REG_A9,   REG_A10,  REG_A11,  REG_A12,  REG_A13,  REG_A14,  REG_A15,
79
        REG_PC,   REG_SPC_FIQ, REG_SPC_IRQ,
80
        REG_SR,   REG_SSR_FIQ, REG_SSR_IRQ, REG_SSR_SWI
81
};
82
 
83
#define REG_LR REG_A14
84
#define REG_SP REG_A15
85
 
86
#define PC REG_PC
87
#define SP REG_A15
88
 
89
#define REGSIZE(X) 4
90
#define REGBYTE(X) ((X)*4)
91
 
92
typedef enum regnames regnames_t;
93
 
94
/* Given a trap value TRAP, return the corresponding signal. */
95
extern int __computeSignal (unsigned int trap_number);
96
 
97
/* Return the SPARC trap number corresponding to the last-taken trap. */
98
extern int __get_trap_number (void);
99
 
100
/* Return the currently-saved value corresponding to register REG. */
101
extern target_register_t get_register (regnames_t reg);
102
 
103
/* Store VALUE in the register corresponding to WHICH. */
104
extern void put_register (regnames_t which, target_register_t value);
105
 
106
/* Set the currently-saved pc register value to PC. This also updates NPC
107
   as needed. */
108
#if !defined(SET_PC_PROTOTYPE_EXISTS) && !defined(set_pc)
109
#define SET_PC_PROTOTYPE_EXISTS
110
extern void set_pc (target_register_t pc);
111
#endif
112
 
113
/* Set things up so that the next user resume will execute one instruction.
114
   This may be done by setting breakpoints or setting a single step flag
115
   in the saved user registers, for example. */
116
#ifndef __single_step
117
void __single_step (void);
118
#endif
119
 
120
/* Clear the single-step state. */
121
void __clear_single_step (void);
122
 
123
extern int __is_bsp_syscall(void);
124
 
125
extern int hal_syscall_handler(void);
126
 
127
/* If the breakpoint we hit is in the breakpoint() instruction, return a
128
   non-zero value. */
129
#ifndef __is_breakpoint_function
130
extern int __is_breakpoint_function (void);
131
#endif
132
 
133
/* Skip the current instruction. */
134
extern void __skipinst (void);
135
 
136
extern void __install_breakpoints (void);
137
 
138
extern void __clear_breakpoints (void);
139
 
140
extern void __install_breakpoint_list (void);
141
 
142
extern void __clear_breakpoint_list (void);
143
 
144
extern unsigned char  __read_prog_uint8(void *addr);
145
extern unsigned short __read_prog_uint16(void *addr);
146
extern unsigned long  __read_prog_uint32(void *addr);
147
 
148
extern void __write_prog_uint8(void *addr, unsigned char val);
149
extern void __write_prog_uint16(void *addr, unsigned short val);
150
extern void __write_prog_uint32(void *addr, unsigned long val);
151
 
152
#ifdef __cplusplus
153
}      /* extern "C" */
154
#endif
155
 
156
#endif // ifndef CYGONCE_HAL_MIPS_STUB_H

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.