更新日期: 2022/06/01 来源: https://gitee.com/weharmony/kernel_liteos_a_note
Hardware
Hardware 的协作图:

函数

VOID FlushICache (VOID)
 Invalidate instruction cache. 更多...
 
VOID DCacheFlushRange (UINTPTR start, UINTPTR end)
 Flush data cache. 更多...
 
VOID DCacheInvRange (UINTPTR start, UINTPTR end)
 Invalidate data cache. 更多...
 
STATIC INLINE const CHARLOS_CpuInfo (VOID)
 Get cpu core name. 更多...
 

详细描述

函数说明

◆ DCacheFlushRange()

VOID DCacheFlushRange ( UINTPTR  start,
UINTPTR  end 
)

Flush data cache.

Description:
  • This API is used to flush the data cache to the memory.
注意
  • The input end address must be greater than the input start address.
参数
start[IN] Type int Flush start address.
end[IN] Type int Flush end address.
返回值
#None.
Dependency:
los_hw.h: the header file that contains the API declaration.
参见
None.

◆ DCacheInvRange()

VOID DCacheInvRange ( UINTPTR  start,
UINTPTR  end 
)

Invalidate data cache.

Description:
  • This API is used to Invalidate the data in cache.
注意
  • The input end address must be greater than the input start address.
参数
start[IN] Type int Invalidate start address.
end[IN] Type int Invalidate end address .
返回值
#None.
Dependency:
los_hw.h: the header file that contains the API declaration.
参见
None.

◆ FlushICache()

VOID FlushICache ( VOID  )

Invalidate instruction cache.

Description:
  • This API is used to invalidate the instruction cache.
注意
None.
参数
None.
返回值
#None.
Dependency:
los_hw.h: the header file that contains the API declaration.
参见
None.

在文件 los_hw.c161 行定义.

162{
163 /*
164 * Use ICIALLUIS instead of ICIALLU. ICIALLUIS operates on all processors in the Inner
165 * shareable domain of the processor that performs the operation.
166 */
167 __asm__ __volatile__ ("mcr p15, 0, %0, c7, c1, 0" : : "r" (0) : "memory");
168}

◆ LOS_CpuInfo()

STATIC INLINE const CHAR * LOS_CpuInfo ( VOID  )

Get cpu core name.

Description:
  • This API is used to get cpu core name.
注意
  • None.
参数

retval CHAR * cpu core name.

Dependency:
los_hw.h: the header file that contains the API declaration.
参见
None.

在文件 los_hw.h168 行定义.

169{
170 INT32 i;
171 UINT32 midr = OsMainIDGet();
172 /* [15:4] is the primary part number */
173 UINT32 partNo = (midr & 0xFFF0) >> 0x4;
174
175 for (i = 0; g_cpuTable[i].partNo != 0; i++) {
176 if (partNo == g_cpuTable[i].partNo) {
177 return g_cpuTable[i].cpuName;
178 }
179 }
180
181 return "unknown";
182}
CpuVendor g_cpuTable[]
Definition: los_hw.c:37
STATIC INLINE UINT32 OsMainIDGet(VOID)
获取CPU型号,包含CPU各种信息,例如:[15:4]表示 arm 7或arm 9
Definition: los_hw_cpu.h:182
signed int INT32
Definition: los_typedef.h:60
unsigned int UINT32
Definition: los_typedef.h:57
const CHAR * cpuName
CPU名称
Definition: los_hw.h:71
const UINT32 partNo
编号
Definition: los_hw.h:70
函数调用图:
这是这个函数的调用关系图: