FreeBSD/sys/geom/vinum/geom_vinum_drive.c
/* Checks for legacy format depending on platform. */
Checks for legacy format depending on platform.
Checks for legacy format depending on platform .
static int
gv_legacy_header_type(uint8_t *hdr, int bigendian)
{
	uint32_t *i32;
	int arch_32, arch_64, i;
	if (bigendian) {
		arch_32 = GV_LEGACY_POWERPC;
		arch_64 = GV_LEGACY_SPARC64;
	} else {
		arch_32 = GV_LEGACY_I386;
		arch_64 = GV_LEGACY_AMD64;
	}
	i32 = (uint32_t *)(hdr + 12);
	if (*i32 != 0)
		return (arch_32);
	if (hdr[16] != 0)
		return (arch_64);
	for (i = 100; i < 120; i++)
		if (hdr[i] != 0)
			return (arch_32);
	i32 = (uint32_t *)(hdr + 84);
	if (*i32 == 0)
		return (arch_64);
	return (arch_32);
}
static int gv_legacy_header_type ( uint8_t * hdr , int bigendian ) { uint32_t * i32 ; int arch_32 , arch_64 , i ; if ( bigendian ) { arch_32 = GV_LEGACY_POWERPC ; arch_64 = GV_LEGACY_SPARC64 ; } else { arch_32 = GV_LEGACY_I386 ; arch_64 = GV_LEGACY_AMD64 ; } i32 = ( uint32_t * ) ( hdr + 12 ) ; if ( * i32 != 0 ) return ( arch_32 ) ; if ( hdr [ 16 ] != 0 ) return ( arch_64 ) ; for ( i = 100 ; i < 120 ; i ++ ) if ( hdr [ i ] != 0 ) return ( arch_32 ) ; i32 = ( uint32_t * ) ( hdr + 84 ) ; if ( * i32 == 0 ) return ( arch_64 ) ; return ( arch_32 ) ; }
Checks for legacy format depending on platform.
Checks for legacy format depending on platform .
/* Set arch according to endianness. */ /* if non-empty hostname overlaps 64-bit config_length */ /* check for non-empty hostname */ /* check bytes past 32-bit structure */ /* check for overlapping timestamp */