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

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [include/] [l4/] [arch/] [arm/] [asm.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
 
2
#ifndef __ARCH_ARM_ASM_H__
3
#define __ARCH_ARM_ASM_H__
4
 
5
 
6
/* Top nibble of the byte denotes irqs/fiqs disabled, ARM state */
7
#define ARM_MODE_MASK   0x1F
8
 
9
#define ARM_MODE_SVC    0x13
10
#define ARM_MODE_UND    0x1B
11
#define ARM_MODE_ABT    0x17
12
#define ARM_MODE_IRQ    0x12
13
#define ARM_MODE_FIQ    0x11
14
#define ARM_MODE_USR    0x10
15
#define ARM_MODE_SYS    0x1F
16
#define ARM_NOIRQ_SVC   0xD3
17
#define ARM_NOIRQ_UND   0xDB
18
#define ARM_NOIRQ_ABT   0xD7
19
#define ARM_NOIRQ_IRQ   0xD2
20
#define ARM_NOIRQ_FIQ   0xD1
21
#define ARM_NOIRQ_USR   0xD0
22
#define ARM_NOIRQ_SYS   0xDF
23
 
24
/* For enabling *clear* these bits */
25
#define ARM_IRQ_BIT     0x080
26
#define ARM_FIQ_BIT     0x040
27
#define ARM_A_BIT       0x100 /* Asynchronous abort */
28
 
29
/* Notes about ARM instructions:
30
 *
31
 * TST instruction:
32
 *
33
 * Essentially TST "AND"s two values and the result affects the Z (Zero bit)
34
 * in CPSR, which can be used for conditions. For example in:
35
 *
36
 *      TST r0, #VALUE
37
 *
38
 * If anding r0 and #VALUE results in a positive value (i.e. they have a
39
 * common bit set as 1) then Z bit is 0, which accounts for an NE (Not equal)
40
 * condition. Consequently, e.g. a BEQ instruction would be skipped and a BNE
41
 * would be executed.
42
 *
43
 * In the opposite case, r0 and #VALUE has no common bits, and anding them
44
 * results in 0. This means Z bit is 1, and any EQ instruction coming afterwards
45
 * would be executed.
46
 *
47
 * I have made this explanation here because I think the behaviour of the Z bit
48
 * is not very clear in TST. Normally Z bit is used for equivalence (e.g. CMP
49
 * instruction) but in TST case even if two values were equal the Z bit could
50
 * point to an NE or EQ condition depending on whether the values have non-zero
51
 * bits.
52
 */
53
 
54
 
55
#define dbg_stop_here()         __asm__ __volatile__ (  "bkpt   #0\n" :: )
56
 
57
#define BEGIN_PROC(name)                        \
58
    .global name;                               \
59
    .type   name,function;                      \
60
    .align;                                     \
61
name:
62
 
63
#define END_PROC(name)                          \
64
.fend_##name:                                   \
65
    .size   name,.fend_##name - name;
66
 
67
#endif /* __ARCH_ARM_ASM_H__ */

powered by: WebSVN 2.1.0

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