aboutsummaryrefslogtreecommitdiff
path: root/asm-v7.s
blob: 17d7110e22afb294fa5b33be5213eb8680cc7c20 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  .syntax unified
  .cfi_sections .debug_frame

  .section .text.__basepri_max
  .global __basepri_max
  .thumb_func
  .cfi_startproc
__basepri_max:
  msr BASEPRI_MAX, r0
  bx lr
  .cfi_endproc
  .size __basepri_max, . - __basepri_max

  .section .text.__basepri_r
  .global __basepri_r
  .thumb_func
  .cfi_startproc
__basepri_r:
  mrs r0, BASEPRI
  bx lr
  .cfi_endproc
  .size __basepri_r, . - __basepri_r

  .section .text.__basepri_w
  .global __basepri_w
  .thumb_func
  .cfi_startproc
__basepri_w:
  msr BASEPRI, r0
  bx lr
  .cfi_endproc
  .size __basepri_w, . - __basepri_w

  .section .text.__faultmask
  .global __faultmask
  .thumb_func
  .cfi_startproc
__faultmask:
  mrs r0, FAULTMASK
  bx lr
  .cfi_endproc
  .size __faultmask, . - __faultmask

  .section .text.__enable_icache
  .global __enable_icache
  .thumb_func
  .cfi_startproc
__enable_icache:
  ldr r0, =0xE000ED14       @ CCR
  mrs r2, PRIMASK           @ save critical nesting info
  cpsid i                   @ mask interrupts
  ldr r1, [r0]              @ read CCR
  orr.w r1, r1, #(1 << 17)  @ Set bit 17, IC
  str r1, [r0]              @ write it back
  dsb                       @ ensure store completes
  isb                       @ synchronize pipeline
  msr PRIMASK, r2           @ unnest critical section
  bx lr
  .cfi_endproc
  .size __enable_icache, . - __enable_icache

  .section .text.__enable_dcache
  .global __enable_dcache
  .thumb_func
  .cfi_startproc
__enable_dcache:
  ldr r0, =0xE000ED14       @ CCR
  mrs r2, PRIMASK           @ save critical nesting info
  cpsid i                   @ mask interrupts
  ldr r1, [r0]              @ read CCR
  orr.w r1, r1, #(1 << 16)  @ Set bit 16, DC
  str r1, [r0]              @ write it back
  dsb                       @ ensure store completes
  isb                       @ synchronize pipeline
  msr PRIMASK, r2           @ unnest critical section
  bx lr
  .cfi_endproc
  .size __enable_dcache, . - __enable_dcache