📄 syscon.c
字号:
************************************************************************/
static UINT32
cpu_icache_assoc_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = sys_icache_assoc;
return OK;
}
/************************************************************************
* cpu_dcache_size_generic_read
************************************************************************/
static UINT32
cpu_dcache_size_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = sys_dcache_linesize * sys_dcache_lines;
return OK;
}
/************************************************************************
* cpu_dcache_linesize_generic_read
************************************************************************/
static UINT32
cpu_dcache_linesize_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = sys_dcache_linesize;
return OK;
}
/************************************************************************
* cpu_dcache_assoc_generic_read
************************************************************************/
static UINT32
cpu_dcache_assoc_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = sys_dcache_assoc;
return OK;
}
/************************************************************************
* board_systemram_actual_size_generic_read
************************************************************************/
static UINT32
board_systemram_actual_size_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = sys_ramsize;
return OK;
}
/************************************************************************
* cpu_icache_size_current_generic_read
************************************************************************/
static UINT32
cpu_icache_size_current_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = sys_determine_icache_linesize(sys_processor) *
sys_determine_icache_lines(sys_processor);
return OK;
}
/************************************************************************
* cpu_icache_linesize_current_generic_read
************************************************************************/
static UINT32
cpu_icache_linesize_current_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = sys_determine_icache_linesize(sys_processor);
return OK;
}
/************************************************************************
* cpu_icache_assoc_current_generic_read
************************************************************************/
static UINT32
cpu_icache_assoc_current_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = sys_determine_icache_assoc(sys_processor);
return OK;
}
/************************************************************************
* cpu_dcache_size_current_generic_read
************************************************************************/
static UINT32
cpu_dcache_size_current_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = sys_determine_dcache_linesize(sys_processor) *
sys_determine_dcache_lines(sys_processor);
return OK;
}
/************************************************************************
* cpu_dcache_linesize_current_generic_read
************************************************************************/
static UINT32
cpu_dcache_linesize_current_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = sys_determine_dcache_linesize(sys_processor);
return OK;
}
/************************************************************************
* cpu_dcache_assoc_current_generic_read
************************************************************************/
static UINT32
cpu_dcache_assoc_current_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = sys_determine_dcache_assoc(sys_processor);
return OK;
}
/************************************************************************
* cpu_cp0_config_reset_generic_read
************************************************************************/
static UINT32
cpu_cp0_config_reset_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = config_init;
return OK;
}
/************************************************************************
* disk_environment_generic_read
************************************************************************/
static UINT32
disk_environment_generic_read(
void *param,
void *data )
{
return SYSENV_read( param );
}
/************************************************************************
* file_batch_access_generic_read
************************************************************************/
static UINT32
file_batch_access_generic_read(
void *param,
void *data )
{
t_sys_batch_file_descriptor *dp ;
dp = param ;
if (dp->mode == SYSCON_FILE_READ_MODE)
{
return( NET_file_read( dp->host_ip,
dp->file_name,
dp->buffer,
&(dp->buffer_size) ) ) ;
}
else
{
return( NET_file_write( dp->host_ip,
dp->file_name,
dp->buffer,
&(dp->buffer_size) ) ) ;
}
}
/************************************************************************
* file_bootserver_generic_read
************************************************************************/
static UINT32
file_bootserver_generic_read(
void *param,
void *data )
{
return
env_get( "bootserver", NULL, param, sizeof(UINT32) ) ?
OK : ERROR_SYSCON_IP_UNKNOWN;
}
/************************************************************************
* disk_environment_generic_write
************************************************************************/
static UINT32
disk_environment_generic_write(
void *param,
void *data )
{
return SYSENV_write( param );
}
/************************************************************************
* error_register_lookup_generic_write
************************************************************************/
static UINT32
error_register_lookup_generic_write(
void *param,
void *data )
{
UINT32 tl;
/* write user environment data */
tl = ((t_sys_error_lookup_registration*)param)->prefix;
if( tl < SYSERROR_DOMAIN_COUNT )
{
registered_lookup[tl] =
((t_sys_error_lookup_registration*)param)->lookup;
return OK;
}
else
{
return ERROR_SYSCON_UNKNOWN_PARAM;
}
}
/************************************************************************
* error_lookup_generic_read
************************************************************************/
static UINT32
error_lookup_generic_read(
void *param,
void *data )
{
UINT32 tl;
UINT32 rcode;
/* lookup syserror by registered domain service */
tl = SYSERROR_DOMAIN( ((t_sys_error_string*)param)->syserror );
if( ( tl < SYSERROR_DOMAIN_COUNT ) &&
( registered_lookup[tl] != NULL ) )
{
rcode = (*registered_lookup[tl])( (t_sys_error_string*)param );
if ( ( rcode != OK) ||
( ((t_sys_error_string*)param)->count == 0 ) )
{
/* Force internal error message */
tl = ((t_sys_error_string*)param)->syserror ;
sprintf( syscon_generic_error_string, "Internal, code = %x", tl ) ;
((t_sys_error_string*)param)->strings[SYSCON_ERRORMSG_IDX] =
syscon_generic_error_string ;
((t_sys_error_string*)param)->count = 1 ;
}
return OK;
}
else
{
/* Force internal error message */
tl = ((t_sys_error_string*)param)->syserror ;
sprintf( syscon_generic_error_string, "Internal, code = %x", tl ) ;
((t_sys_error_string*)param)->strings[SYSCON_ERRORMSG_IDX] =
syscon_generic_error_string ;
((t_sys_error_string*)param)->count = 1 ;
return OK ;
}
}
/************************************************************************
* cpu_cp0_index_generic_read
************************************************************************/
static UINT32
cpu_cp0_index_generic_read(
void *param,
void *data )
{
*(UINT32*)param = CP0_index_read();
return OK;
}
/************************************************************************
* cpu_cp0_index_generic_write
************************************************************************/
static UINT32
cpu_cp0_index_generic_write(
void *param,
void *data )
{
CP0_index_write( *(UINT32 *)param );
return OK;
}
/************************************************************************
* cpu_cp0_ecc_generic_read
************************************************************************/
static UINT32
cpu_cp0_ecc_generic_read(
void *param,
void *data )
{
*(UINT32 *)param = CP0_ecc_read();
return OK;
}
/************************************************************************
* cpu_cp0_ecc_generic_write
************************************************************************/
static UINT32
cpu_cp0_ecc_generic_write(
void *param,
void *data )
{
CP0_ecc_write( *(UINT32 *)param );
return OK;
}
/************************************************************************
* cpu_cp0_random_generic_read
************************************************************************/
static UINT32
cpu_cp0_random_generic_read(
void *param,
void *data )
{
*(UINT32*)param = CP0_random_read();
return OK;
}
/************************************************************************
* cpu_cp0_entrylo0_generic_read
************************************************************************/
static UINT32
cpu_cp0_entrylo0_generic_read(
void *param,
void *data )
{
*(UINT32*)param = CP0_entrylo0_read();
return OK;
}
/************************************************************************
* cpu_cp0_entrylo0_generic_write
************************************************************************/
static UINT32
cpu_cp0_entrylo0_generic_write(
void *param,
void *data )
{
CP0_entrylo0_write( *(UINT32 *)param );
return OK;
}
/************************************************************************
* cpu_cp0_entrylo1_generic_read
************************************************************************/
static UINT32
cpu_cp0_entrylo1_generic_read(
void *param,
void *data )
{
*(UINT32*)param = CP0_entrylo1_read();
return OK;
}
/************************************************************************
* cpu_cp0_entrylo1_generic_write
************************************************************************/
static UINT32
cpu_cp0_entrylo1_generic_write(
void *param,
void *data )
{
CP0_entrylo1_write( *(UINT32 *)param );
return OK;
}
/************************************************************************
* cpu_cp0_context_generic_read
************************************************************************/
static UINT32
cpu_cp0_context_generic_read(
void *param,
void *data )
{
*(UINT32*)param = CP0_context_read();
return OK;
}
/************************************************************************
* cpu_cp0_context_generic_write
************************************************************************/
static UINT32
cpu_cp0_context_generic_write(
void *param,
void *data )
{
CP0_context_write( *(UINT32 *)param );
return OK;
}
/************************************************************************
* cpu_cp0_pagemask_generic_read
************************************************************************/
static UINT32
cpu_cp0_pagemask_generic_read(
void *param,
void *data )
{
*(UINT32*)param = CP0_pagemask_read();
return OK;
}
/************************************************************************
* cpu_cp0_pagemask_generic_write
************************************************************************/
static UINT32
cpu_cp0_pagemask_generic_write(
void *param,
void *data )
{
CP0_pagemask_write( *(UINT32 *)param );
return OK;
}
/************************************************************************
* cpu_cp0_wired_generic_read
************************************************************************/
static UINT32
cpu_cp0_wired_generic_read(
void *param,
void *data )
{
*(UINT32*)param = CP0_wired_read();
return OK;
}
/************************************************************************
* cpu_cp0_wired_generic_write
************************************************************************/
static UINT32
cpu_cp0_wired_generic_write(
void *param,
void *data )
{
CP0_wired_write( *(UINT32 *)param );
return OK;
}
/************************************************************************
* cpu_cp0_badvaddr_generic_read
************************************************************************/
static UINT32
cpu_cp0_badvaddr_generic_read(
void *param,
void *data )
{
*(UINT32*)param = CP0_badvaddr_read();
return OK;
}
/************************************************************************
* cpu_cp0_count_generic_read
************************************************************************/
static UINT32
cpu_cp0_count_generic_read(
void *param,
void *data )
{
*(UINT32*)param = CP0_count_read();
return OK;
}
/************************************************************************
* cpu_cp0_count_generic_write
************************************************************************/
static UINT32
cpu_cp0_count_generic_write(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -