FreeBSD/tools/tools/vxge/vxge_log.c
/*
 * vxge_print_registers
 * Prints/logs Register values
 * @registers Register values
 */
vxge_print_registers
Prints/logs Register values
@registers Register values
vxge_print_registers Prints / logs Register values @registers Register values
void
vxge_print_registers(void *registers)
{
	int i = 0, j = 0;
	u64 noffset, nRegValue = 0;
	char szName[64];
	fdAll = fopen("vxge_regs.log", "w+");
	if (!fdAll)
		return;
	VXGE_PRINT_REG_NAME(fdAll, "Registers : COMMON");
	VXGE_PRINT_HEADER_REGS(fdAll);
	for (i = 0; i < VXGE_HAL_MGMT_REG_COUNT_COMMON; i++) {
		if (reginfo_registers[i].size == 1)
			strlcpy(szName, reginfo_registers[i].name,
			    sizeof(szName));
		for (j = 0; j < reginfo_registers[i].size; j++) {
			noffset = reginfo_registers[i].offset + (0x8 * j);
			if (reginfo_registers[i].size > 1)
				snprintf(szName, sizeof(szName),
				    reginfo_registers[i].name, j);
			nRegValue = *((u64 *) ((unsigned char *) registers +
			    noffset));
			VXGE_PRINT_REGS(fdAll, (const char *) szName, noffset,
			    nRegValue);
		}
	}
	VXGE_PRINT_LINE(fdAll);
	fclose(fdAll);
}
void vxge_print_registers ( void * registers ) { int i = 0 , j = 0 ; u64 noffset , nRegValue = 0 ; char szName [ 64 ] ; fdAll = fopen ( " " , " " ) ; if ( ! fdAll ) return ; VXGE_PRINT_REG_NAME ( fdAll , " " ) ; VXGE_PRINT_HEADER_REGS ( fdAll ) ; for ( i = 0 ; i < VXGE_HAL_MGMT_REG_COUNT_COMMON ; i ++ ) { if ( reginfo_registers [ i ] . size == 1 ) strlcpy ( szName , reginfo_registers [ i ] . name , sizeof ( szName ) ) ; for ( j = 0 ; j < reginfo_registers [ i ] . size ; j ++ ) { noffset = reginfo_registers [ i ] . offset + ( 0x8 * j ) ; if ( reginfo_registers [ i ] . size > 1 ) snprintf ( szName , sizeof ( szName ) , reginfo_registers [ i ] . name , j ) ; nRegValue = * ( ( u64 * ) ( ( unsigned char * ) registers + noffset ) ) ; VXGE_PRINT_REGS ( fdAll , ( const char * ) szName , noffset , nRegValue ) ; } } VXGE_PRINT_LINE ( fdAll ) ; fclose ( fdAll ) ; }
vxge_print_registers
 Prints/logs Register values
 @registers Register values
vxge_print_registers Prints / logs Register values @registers Register values