123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- /*++
- Copyright (c) 2013 Minoca Corp. All Rights Reserved
- Module Name:
- archsup.S
- Abstract:
- This module implements assembly-based architecture support routines for the
- ARMv6 platform.
- Author:
- Chris Stevens 2-Feb-2014
- Environment:
- Boot
- --*/
- ##
- ## ------------------------------------------------------------------- Includes
- ##
- #include <minoca/kernel/arm.inc>
- ##
- ## ---------------------------------------------------------------- Definitions
- ##
- ##
- ## ---------------------------------------------------------------------- Code
- ##
- ASSEMBLY_FILE_HEADER
- ##
- ## VOID
- ## BoInvalidateEntireCache (
- ## VOID
- ## )
- ##
- /*++
- Routine Description:
- This routine invalidates the entire data cache.
- Arguments:
- None.
- Return Value:
- None.
- --*/
- FUNCTION BoInvalidateEntireCache
- mov %r1, #0
- mcr p15, 0, %r1, %cr7, %cr6, 0 @ Invalidate entire data cache.
- mcr p15, 0, %r1, %cr7, %cr10, 4 @ Data Synchronization barrier.
- bx %lr
- END_FUNCTION BoInvalidateEntireCache
- ##
- ## ULONG
- ## ArGetMultiprocessorIdRegister (
- ## VOID
- ## )
- ##
- /*++
- Routine Description:
- This routine gets the Multiprocessor ID register (MPIDR).
- Arguments:
- None.
- Return Value:
- Returns the value of the MPIDR.
- --*/
- FUNCTION ArGetMultiprocessorIdRegister
- ##
- ## The MPIDR does not exist on ARMv6; return 0.
- ##
- mov %r0, #0
- bx %lr
- END_FUNCTION ArGetMultiprocessorIdRegister
- ##
- ## ULONG
- ## ArGetPerformanceControlRegister (
- ## VOID
- ## )
- ##
- /*++
- Routine Description:
- This routine retrieves the PMCR (Performance Monitor Control Register).
- Arguments:
- None.
- Return Value:
- Returns the value of the PMCR.
- --*/
- FUNCTION ArGetPerformanceControlRegister
- mrc p15, 0, %r0, %c15, %c12, 0 @ Get the PMCR.
- bx %lr @
- END_FUNCTION ArGetPerformanceControlRegister
- ##
- ## VOID
- ## ArSetPerformanceControlRegister (
- ## ULONG Value
- ## )
- ##
- /*++
- Routine Description:
- This routine sets the PMCR (Performance Monitor Control Register).
- Arguments:
- Value - Supplies the value to set in the PMCR.
- Return Value:
- None.
- --*/
- FUNCTION ArSetPerformanceControlRegister
- mcr p15, 0, %r0, %c15, %c12, 0 @ Set the PMCR.
- bx %lr @
- END_FUNCTION ArSetPerformanceControlRegister
- ##
- ## ULONG
- ## ArGetCycleCountRegister (
- ## VOID
- ## )
- ##
- /*++
- Routine Description:
- This routine retrieves the PMCCNTR (Performance Monitor Cycle Counter)
- register.
- Arguments:
- None.
- Return Value:
- Returns the value of the PMCCNTR.
- --*/
- FUNCTION ArGetCycleCountRegister
- mrc p15, 0, %r0, %c15, %c12, 1 @ Get the PMCCNTR register.
- bx %lr @
- END_FUNCTION ArGetCycleCountRegister
- ##
- ## --------------------------------------------------------- Internal Functions
- ##
|