summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJonah Willis2019-01-31 11:54:43 -0600
committerJonah Willis2019-03-07 09:24:57 -0600
commitd52408600294aff80f24afdb039b4570c03fa3d3 (patch)
tree634eb48c346ab3a1bbe56bd8ba63780d9d1387b9 /arch
parentde351bf70446d95b6268eeecb24d6013b44d60d2 (diff)
downloadosal-d52408600294aff80f24afdb039b4570c03fa3d3.tar.gz
osal-d52408600294aff80f24afdb039b4570c03fa3d3.tar.xz
osal-d52408600294aff80f24afdb039b4570c03fa3d3.zip
Define cp15 assembly symbols as functions
This change allows for gcc to interwork ARM mode assembly functions with Thumb mode OSAL code. PRSDK-5220 Signed-off-by: Jonah Willis <j-willis@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/core/a8/cp15.asm27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/core/a8/cp15.asm b/arch/core/a8/cp15.asm
index 6ea545f..686fbac 100644
--- a/arch/core/a8/cp15.asm
+++ b/arch/core/a8/cp15.asm
@@ -89,6 +89,7 @@
89@***************************************************************************** 89@*****************************************************************************
90@ This API disables the Instruction cache. 90@ This API disables the Instruction cache.
91@***************************************************************************** 91@*****************************************************************************
92.type CP15ICacheDisable, %function
92CP15ICacheDisable: 93CP15ICacheDisable:
93 PUSH {lr} 94 PUSH {lr}
94 MRC p15, #0, r0, c1, c0, #0 95 MRC p15, #0, r0, c1, c0, #0
@@ -101,6 +102,7 @@ CP15ICacheDisable:
101@***************************************************************************** 102@*****************************************************************************
102@ This API disables the Data cache. 103@ This API disables the Data cache.
103@***************************************************************************** 104@*****************************************************************************
105.type CP15DCacheDisable, %function
104CP15DCacheDisable: 106CP15DCacheDisable:
105 PUSH {r4-r11, lr} 107 PUSH {r4-r11, lr}
106 MRC p15, #0, r0, c1, c0, #0 108 MRC p15, #0, r0, c1, c0, #0
@@ -113,6 +115,7 @@ CP15DCacheDisable:
113@***************************************************************************** 115@*****************************************************************************
114@ This API enables I-cache 116@ This API enables I-cache
115@***************************************************************************** 117@*****************************************************************************
118.type CP15ICacheEnable, %function
116CP15ICacheEnable: 119CP15ICacheEnable:
117 MRC p15, #0, r0, c1, c0, #0 120 MRC p15, #0, r0, c1, c0, #0
118 ORR r0, r0, #0x00001000 121 ORR r0, r0, #0x00001000
@@ -122,6 +125,7 @@ CP15ICacheEnable:
122@***************************************************************************** 125@*****************************************************************************
123@ This API enables the Data cache. 126@ This API enables the Data cache.
124@***************************************************************************** 127@*****************************************************************************
128.type CP15DCacheEnable, %function
125CP15DCacheEnable: 129CP15DCacheEnable:
126 MRC p15, #0, r0, c1, c0, #0 130 MRC p15, #0, r0, c1, c0, #0
127 ORR r0, r0, #0x00000004 131 ORR r0, r0, #0x00000004
@@ -131,6 +135,7 @@ CP15DCacheEnable:
131@***************************************************************************** 135@*****************************************************************************
132@ This API Invalidates the entire Data/Unified Cache 136@ This API Invalidates the entire Data/Unified Cache
133@***************************************************************************** 137@*****************************************************************************
138.type CP15DCacheFlush, %function
134CP15DCacheFlush: 139CP15DCacheFlush:
135 PUSH {r4-r11} 140 PUSH {r4-r11}
136 DMB 141 DMB
@@ -179,6 +184,7 @@ ffinished:
179@***************************************************************************** 184@*****************************************************************************
180@ This API cleans the entire D Cache to PoC 185@ This API cleans the entire D Cache to PoC
181@***************************************************************************** 186@*****************************************************************************
187.type CP15DCacheClean, %function
182CP15DCacheClean: 188CP15DCacheClean:
183 PUSH {r4-r11} 189 PUSH {r4-r11}
184 DMB 190 DMB
@@ -227,6 +233,7 @@ cfinished:
227@***************************************************************************** 233@*****************************************************************************
228@ This API cleans and invalidates the entire D Cache to PoC 234@ This API cleans and invalidates the entire D Cache to PoC
229@***************************************************************************** 235@*****************************************************************************
236.type CP15DCacheCleanFlush, %function
230CP15DCacheCleanFlush: 237CP15DCacheCleanFlush:
231 PUSH {r4-r11} 238 PUSH {r4-r11}
232 DMB 239 DMB
@@ -275,6 +282,7 @@ finished:
275@***************************************************************************** 282@*****************************************************************************
276@ This API invalidates entire I Cache 283@ This API invalidates entire I Cache
277@***************************************************************************** 284@*****************************************************************************
285.type CP15ICacheFlush, %function
278CP15ICacheFlush: 286CP15ICacheFlush:
279 MOV r0, #0 287 MOV r0, #0
280 MCR p15, #0, r0, c7, c5, #0 288 MCR p15, #0, r0, c7, c5, #0
@@ -287,6 +295,7 @@ CP15ICacheFlush:
287@ r0 - Start Address 295@ r0 - Start Address
288@ r1 - Number of bytes to be cleaned 296@ r1 - Number of bytes to be cleaned
289@***************************************************************************** 297@*****************************************************************************
298.type CP15DCacheCleanBuff, %function
290CP15DCacheCleanBuff: 299CP15DCacheCleanBuff:
291 PUSH {r14} 300 PUSH {r14}
292 ADD r14, r0, r1 @ Calculate the end address 301 ADD r14, r0, r1 @ Calculate the end address
@@ -320,6 +329,7 @@ cleanloop:
320@ r0 - Start Address 329@ r0 - Start Address
321@ r1 - Number of bytes to be cleaned and flushed 330@ r1 - Number of bytes to be cleaned and flushed
322@***************************************************************************** 331@*****************************************************************************
332.type CP15DCacheCleanFlushBuff, %function
323CP15DCacheCleanFlushBuff: 333CP15DCacheCleanFlushBuff:
324 PUSH {r14} 334 PUSH {r14}
325 ADD r14, r0, r1 @ Calculate the end address 335 ADD r14, r0, r1 @ Calculate the end address
@@ -353,6 +363,7 @@ cleanflushloop:
353@ r0 - Start Address 363@ r0 - Start Address
354@ r1 - Number of bytes to be flushed 364@ r1 - Number of bytes to be flushed
355@***************************************************************************** 365@*****************************************************************************
366.type CP15DCacheFlushBuff, %function
356CP15DCacheFlushBuff: 367CP15DCacheFlushBuff:
357 PUSH {r14} 368 PUSH {r14}
358 ADD r14, r0, r1 @ Calculate the end address 369 ADD r14, r0, r1 @ Calculate the end address
@@ -391,6 +402,7 @@ dflushcmp:
391@ r0 - Start Address 402@ r0 - Start Address
392@ r1 - Number of bytes to be cleaned 403@ r1 - Number of bytes to be cleaned
393@***************************************************************************** 404@*****************************************************************************
405.type CP15ICacheFlushBuff, %function
394CP15ICacheFlushBuff: 406CP15ICacheFlushBuff:
395 PUSH {r14} 407 PUSH {r14}
396 ADD r14, r0, r1 @ Calculate the end address 408 ADD r14, r0, r1 @ Calculate the end address
@@ -422,6 +434,7 @@ iflushloop:
422@ Sets TTB0 Register 434@ Sets TTB0 Register
423@ r0 - Translation Table Base Address 435@ r0 - Translation Table Base Address
424@***************************************************************************** 436@*****************************************************************************
437.type CP15Ttb0Set, %function
425CP15Ttb0Set: 438CP15Ttb0Set:
426 MCR p15, #0, r0, c2, c0, #0 439 MCR p15, #0, r0, c2, c0, #0
427 DMB 440 DMB
@@ -430,6 +443,7 @@ CP15Ttb0Set:
430@***************************************************************************** 443@*****************************************************************************
431@ This API Invalidates the TLB 444@ This API Invalidates the TLB
432@***************************************************************************** 445@*****************************************************************************
446.type CP15TlbInvalidate, %function
433CP15TlbInvalidate: 447CP15TlbInvalidate:
434 MCR p15, #0, r0, c8, c7, #0 @ r0 value will be ignored 448 MCR p15, #0, r0, c8, c7, #0 @ r0 value will be ignored
435 DSB 449 DSB
@@ -438,6 +452,7 @@ CP15TlbInvalidate:
438@***************************************************************************** 452@*****************************************************************************
439@ This API Disables MMU. 453@ This API Disables MMU.
440@***************************************************************************** 454@*****************************************************************************
455.type CP15MMUDisable, %function
441CP15MMUDisable: 456CP15MMUDisable:
442 MCR p15, #0, r0, c8, c7, #0 @ Invalidate TLB 457 MCR p15, #0, r0, c8, c7, #0 @ Invalidate TLB
443 MRC p15, #0, r0, c1, c0, #0 458 MRC p15, #0, r0, c1, c0, #0
@@ -449,6 +464,7 @@ CP15MMUDisable:
449@***************************************************************************** 464@*****************************************************************************
450@ This API Enables MMU. 465@ This API Enables MMU.
451@***************************************************************************** 466@*****************************************************************************
467.type CP15MMUEnable, %function
452CP15MMUEnable: 468CP15MMUEnable:
453 MRC p15, #0, r0, c1, c0, #0 469 MRC p15, #0, r0, c1, c0, #0
454 ORR r0, r0, #0x001 470 ORR r0, r0, #0x001
@@ -460,6 +476,7 @@ CP15MMUEnable:
460@ This API sets the interrupt vector table base address 476@ This API sets the interrupt vector table base address
461@ r0 - Interrupt Vector Base Address 477@ r0 - Interrupt Vector Base Address
462@***************************************************************************** 478@*****************************************************************************
479.type CP15VectorBaseAddrSet, %function
463CP15VectorBaseAddrSet: 480CP15VectorBaseAddrSet:
464 MCR p15, #0, r0, c12, c0, #0 481 MCR p15, #0, r0, c12, c0, #0
465 DSB 482 DSB
@@ -468,6 +485,7 @@ CP15VectorBaseAddrSet:
468@***************************************************************************** 485@*****************************************************************************
469@ This API invalidates the branch predictor 486@ This API invalidates the branch predictor
470@***************************************************************************** 487@*****************************************************************************
488.type CP15BranchPredictorInvalidate, %function
471CP15BranchPredictorInvalidate: 489CP15BranchPredictorInvalidate:
472 MCR p15, #0, r0, c7, c5, #6 490 MCR p15, #0, r0, c7, c5, #6
473 ISB 491 ISB
@@ -476,6 +494,7 @@ CP15BranchPredictorInvalidate:
476@***************************************************************************** 494@*****************************************************************************
477@ This API enables the branch predictor 495@ This API enables the branch predictor
478@***************************************************************************** 496@*****************************************************************************
497.type CP15BranchPredictionEnable, %function
479CP15BranchPredictionEnable: 498CP15BranchPredictionEnable:
480 MRC p15, #0, r0, c1, c0, #0 499 MRC p15, #0, r0, c1, c0, #0
481 ORR r0, r0, #0x00000800 500 ORR r0, r0, #0x00000800
@@ -485,6 +504,7 @@ CP15BranchPredictionEnable:
485@***************************************************************************** 504@*****************************************************************************
486@ This API disables the branch predictor 505@ This API disables the branch predictor
487@***************************************************************************** 506@*****************************************************************************
507.type CP15BranchPredictionDisable, %function
488CP15BranchPredictionDisable: 508CP15BranchPredictionDisable:
489 MRC p15, #0, r0, c1, c0, #0 509 MRC p15, #0, r0, c1, c0, #0
490 BIC r0, r0, #0x00000800 510 BIC r0, r0, #0x00000800
@@ -494,6 +514,7 @@ CP15BranchPredictionDisable:
494@***************************************************************************** 514@*****************************************************************************
495@ This API sets the domain access to 'client' 515@ This API sets the domain access to 'client'
496@***************************************************************************** 516@*****************************************************************************
517.type CP15DomainAccessClientSet, %function
497CP15DomainAccessClientSet: 518CP15DomainAccessClientSet:
498 LDR r0, _CLIENTD 519 LDR r0, _CLIENTD
499 MCR p15, #0, r0, c3, c0, #0 520 MCR p15, #0, r0, c3, c0, #0
@@ -517,6 +538,7 @@ CP15DomainAccessClientSet:
517@ they can also be ADDed. 538@ they can also be ADDed.
518@ 539@
519@***************************************************************************** 540@*****************************************************************************
541.type CP15ControlFeatureDisable, %function
520CP15ControlFeatureDisable: 542CP15ControlFeatureDisable:
521 MRC p15, #0, r1, c1, c0, #0 543 MRC p15, #0, r1, c1, c0, #0
522 BIC r0, r1, r0 544 BIC r0, r1, r0
@@ -540,6 +562,7 @@ CP15ControlFeatureDisable:
540@ they can also be ADDed. 562@ they can also be ADDed.
541@ 563@
542@***************************************************************************** 564@*****************************************************************************
565.type CP15ControlFeatureEnable, %function
543CP15ControlFeatureEnable: 566CP15ControlFeatureEnable:
544 MRC p15, #0, r1, c1, c0, #0 567 MRC p15, #0, r1, c1, c0, #0
545 ORR r0, r1, r0 568 ORR r0, r1, r0
@@ -550,6 +573,7 @@ CP15ControlFeatureEnable:
550@***************************************************************************** 573@*****************************************************************************
551@ This API Configures the TTB control register to use only TTB0 574@ This API Configures the TTB control register to use only TTB0
552@***************************************************************************** 575@*****************************************************************************
576.type CP15TtbCtlTtb0Config, %function
553CP15TtbCtlTtb0Config: 577CP15TtbCtlTtb0Config:
554 MOV r0, #0x0 578 MOV r0, #0x0
555 MCR p15, #0, r0, c2, c0, #2 579 MCR p15, #0, r0, c2, c0, #2
@@ -560,6 +584,7 @@ CP15TtbCtlTtb0Config:
560@ This API Sets the specified fields in Auxiliary Control Register 584@ This API Sets the specified fields in Auxiliary Control Register
561@ r0 - Bit Mask for the bits to be set in Auxiliary Control Register 585@ r0 - Bit Mask for the bits to be set in Auxiliary Control Register
562@***************************************************************************** 586@*****************************************************************************
587.type CP15AuxControlFeatureEnable, %function
563CP15AuxControlFeatureEnable: 588CP15AuxControlFeatureEnable:
564 MRC p15, #0, r1, c1, c0, #1 589 MRC p15, #0, r1, c1, c0, #1
565 ORR r0, r0, r1 590 ORR r0, r0, r1
@@ -571,6 +596,7 @@ CP15AuxControlFeatureEnable:
571@ This API Clears the specified fields in Auxiliary Control Register 596@ This API Clears the specified fields in Auxiliary Control Register
572@ r0 - Bit Mask for the bits to be cleared in Auxiliary Control Register 597@ r0 - Bit Mask for the bits to be cleared in Auxiliary Control Register
573@***************************************************************************** 598@*****************************************************************************
599.type CP15AuxControlFeatureDisable, %function
574CP15AuxControlFeatureDisable: 600CP15AuxControlFeatureDisable:
575 MRC p15, #0, r1, c1, c0, #1 601 MRC p15, #0, r1, c1, c0, #1
576 BIC r0, r1, r0 602 BIC r0, r1, r0
@@ -581,6 +607,7 @@ CP15AuxControlFeatureDisable:
581@***************************************************************************** 607@*****************************************************************************
582@ This API returns the main ID register in r0 608@ This API returns the main ID register in r0
583@***************************************************************************** 609@*****************************************************************************
610.type CP15MainIdPrimPartNumGet, %function
584CP15MainIdPrimPartNumGet: 611CP15MainIdPrimPartNumGet:
585 MRC p15, #0, r0, c0, c0, #0 612 MRC p15, #0, r0, c0, c0, #0
586 UBFX r0, r0, #4, #12 613 UBFX r0, r0, #4, #12