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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [include/] [asm-i960/] [i960.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 *   FILE: i960.h
3
 * AUTHOR: kma
4
 *  DESCR: generic definitions of i960 data structures
5
 */
6
 
7
#ifndef I960_H
8
#define I960_H
9
 
10
#ident "$Id: i960.h,v 1.1.1.1 2001-09-10 07:44:41 simons Exp $"
11
 
12
#ifdef __ASSEMBLY__
13
/*
14
 * register saving/restoring code. used by both syscall and interrupt handlers
15
 */
16
 
17
#define current SYMBOL_NAME(current_set)
18
#define SAVE_ALL(freereg) \
19
        ldconst 64, freereg; \
20
        addo    freereg, sp, sp;        \
21
        stq     g0, -64(sp);    \
22
        stq     g4, -48(sp);    \
23
        stq     g8, -32(sp);    \
24
        stq     g12, -16(sp)
25
 
26
#define RESTORE_ALL(freereg) \
27
        ldq     -16(sp), g12;   \
28
        ldq     -32(sp), g8;    \
29
        ldq     -48(sp), g4;    \
30
        ldq     -64(sp), g0;    \
31
        ldconst 64, freereg;    \
32
        subo    freereg, sp, sp
33
 
34
#else
35
typedef unsigned long reg_t;
36
 
37
static inline unsigned long get_ipl(void)
38
{
39
        unsigned long retval;
40
 
41
        __asm__ __volatile__("modpc     0, 0, %0" : "=r" (retval));
42
        return ( (retval >> 16) & 0x1f);
43
}
44
 
45
static inline unsigned long get_pc(void)
46
{
47
        unsigned long retval;
48
        __asm__ __volatile__("modpc     0, 0, %0" : "=r" (retval));
49
        return retval;
50
}
51
/*
52
 * Interrupt record. Every interrupt handler has one located at fp-16.
53
 * We'll ultimately use the saved PC to determine whether we interrupted
54
 * supervisor or user mode.
55
 */
56
typedef struct {
57
        reg_t           ir_pc;
58
        reg_t           ir_ac;
59
        unsigned char   ir_vec; /* vector number of interrupt; only low-order
60
                                   byte is meaningful */
61
} irec_t;
62
typedef void(*isr_t)(irec_t*);
63
 
64
typedef struct {
65
        reg_t   i_pending_pris;         /* priorities w/ pending intrs */
66
        reg_t   i_pending_ints[8];      /* pending interrupts */
67
        isr_t   i_vectors[248];         /* pointers to handlers */
68
} itab_t;
69
 
70
#endif
71
 
72
#endif

powered by: WebSVN 2.1.0

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