sys_api.h

来自「MIPS YAMON, a famous monitor inc. source」· C头文件 代码 · 共 1,385 行 · 第 1/3 页

H
1,385
字号
 * *                          sys_cp0_write32 *  Description : *  ------------- * *  Write 32 bit CP0 register * *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_cp0_write32(    UINT32 number,	/* Register number (0..31) */    UINT32 sel,		/* sel field (0..7)	   */    UINT32 value );	/* Value to be written	   *//************************************************************************ * *                          sys_cp0_write64 *  Description : *  ------------- * *  Write 64 bit CP0 register * *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_cp0_write64(    UINT32 number,	/* Register number (0..31) */    UINT32 sel,		/* sel field (0..7)	   */    UINT64 value );	/* Value to be written	   *//************************************************************************ * *                          sys_cp1_read *  Description : *  ------------- * *  Read CP1 register * *  Return values : *  --------------- * *  Value read * ************************************************************************/UINT32sys_cp1_read(    UINT32 number );	/* Register number (0..31) *//************************************************************************ * *                          sys_cp1_write *  Description : *  ------------- * *  Write CP1 register * *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_cp1_write(    UINT32 number,	/* Register number (0..31) */    UINT32 value );	/* Value to be written	   *//************************************************************************ * *                          sys_fpu_enable *  Description : *  ------------- * *  Enable FPU * ************************************************************************/void sys_fpu_enable( void );/************************************************************************ *                          sys_cpu_cache_bpw ************************************************************************/voidsys_cpu_cache_bpw(    bool         icache,	/* TRUE -> icache, FALSE -> dcache	*/    t_sys_array  *sys_array );/************************************************************************ *                          sys_cpu_cache_assoc ************************************************************************/voidsys_cpu_cache_assoc(    bool         icache,	/* TRUE -> icache, FALSE -> dcache	*/    t_sys_array  *sys_array );/************************************************************************ * *                          sys_scache_flush_index *  Description : *  ------------- * *  Flush L2 cache line containing specified index * *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_scache_flush_index(     UINT32 index );/************************************************************************ * *                          sys_icache_invalidate_index *  Description : *  ------------- * *  Fill I cache line containing specified index * *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_icache_invalidate_index(    UINT32 index );/************************************************************************ * *                          sys_icache_invalidate_addr *  Description : *  ------------- * *  Invalidate I cache line containing specified address. * *  We bypass the cache operations if CPU is running uncached. *  (We assume Config.k0 == K_CacheAttrU is the *  only uncached mode used). * *  Return values : *  --------------- * *  None * ************************************************************************/void sys_icache_invalidate_addr(    UINT32 addr,		/* Address to be invalidated. Must be KSEG0/KSEG1 */    bool   flush_pipeline );    /* TRUE => flush pipeline after invalidation *//************************************************************************ * *                          sys_dcache_flush_index *  Description : *  ------------- * *  Flush D cache line containing specified index * *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_dcache_flush_index(    UINT32 index );/************************************************************************ * *                          sys_dcache_flush_addr *  Description : *  ------------- * *  Flush D cache line containing specified address. * *  We bypass the cache operations if CPU is running uncached. *  (We assume Config.k0 == K_CacheAttrU is the *  only uncached mode used). * *  Return values : *  --------------- * *  None * ************************************************************************/void sys_dcache_flush_addr(    UINT32 addr );   /* Must be KSEG0/KSEG1 *//************************************************************************ * *                          sys_dcache_flush_all *  Description : *  ------------- * *  Flush entire DCACHE. * *  We bypass the cache operations if CPU is running uncached. *  (We assume Config.k0 == K_CacheAttrU is the *  only uncached mode used). * *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_dcache_flush_all( void );/************************************************************************ * *                          sys_icache_invalidate_all *  Description : *  ------------- * *  Invalidate entire ICACHE. * *  We bypass the cache operations if CPU is running uncached. *  (We assume Config.k0 == K_CacheAttrU is the *  only uncached mode used). * *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_icache_invalidate_all( void );/************************************************************************ * *                          sys_flush_caches *  Description : *  ------------- * *  First flush entire DCACHE, then invalidate entire ICACHE * *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_flush_caches( void );/************************************************************************ * *                          sys_flush_pipeline *  Description : *  ------------- * *  Flush pipeline * *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_flush_pipeline( void );/************************************************************************ * *                          sys_flush_cache_line *  Description : *  ------------- * *  First flush DCACHE line, then invalidate ICACHE line * *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_flush_cache_line(     void *addr );/************************************************************************ * *                          sys_cpu_icache_config *  Description : *  ------------- * *  Configure icache * *  Return values : *  --------------- * *  None * ************************************************************************/void sys_cpu_icache_config(     UINT32 is,    UINT32 il,    UINT32 ia,    UINT32 config1_reset );/************************************************************************ * *                          sys_cpu_dcache_config *  Description : *  ------------- * *  Configure dcache *	 *  Return values : *  --------------- * *  None * ************************************************************************/void sys_cpu_dcache_config(     UINT32 ds,    UINT32 dl,    UINT32 da,    UINT32 config1_reset );/************************************************************************ * *                          sys_tlb_lookup *  Description : *  ------------- * *  Probe TLB for matching entry * *  Return values : *  --------------- * *  SYS_TLB_NOTFOUND : No match *  SYS_TLB_NOTVALID : Match with valid bit cleared, i.e. not valid *  SYS_TLB_WP	     : Match with dirty bit cleared, i.e. write-protected *  SYS_TLB_OK       : Valid and Dirty entry found * ************************************************************************/UINT32sys_tlb_lookup(    UINT32 vaddr,		/* Virtual address			*/    UINT32 *phys,		/* OUT : Physical address		*/    UINT32 *pagesize );		/* OUT : Pagesize (byte count)		*//************************************************************************ * *                          sys_tlb_write *  Description : *  ------------- * *  Write TLB * *  data = pointer to array of 5 words *  *  array[0] = index *  array[1] = pagemask *  array[2] = entryhi *  array[3] = entrylo0 *  array[4] = entrylo1 *	 *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_tlb_write(    UINT32 *data );/************************************************************************ * *                          sys_kseg0 *  Description : *  ------------- * *  Determine KSEG0 address corresponding to input address. *  *  In case input address is TLB mapped, a lookup is performed in the *  TLB to determine the physical address. Then, the corresponding *  KSEG0 address is calculated. * *  In case input address is in KSEG1 range, it is converted to KSEG0. * *  In case of fixed mapping TLB, a KUSEG address is mapped to a *  corresponding KSEG0 address based on the ERL setting. * *  Return values : *  --------------- * *  TRUE if conversion was successfull, otherwise FALSE * ************************************************************************/boolsys_kseg0(    UINT32 addr,		/* Address to be converted		*/    UINT32 *kseg0addr );	/* OUT : Converted address		*//************************************************************************ * *                          sys_tlb_read *  Description : *  ------------- * *  Read TLB * *  data = pointer to array of 4 words. They will be filled with  the *         following data : * *  array[0] = pagemask *  array[1] = entryhi *  array[2] = entrylo0 *  array[3] = entrylo1 *	 *  Return values : *  --------------- * *  None * ************************************************************************/voidsys_tlb_read(    UINT32 index,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?