Di_system_subarch

## Functions

const char * | di_system_subarch_analyze (void)
const char * | di_system_subarch_analyze_guess (void)

## Detailed Description

## Function Documentation

## di_system_subarch_analyze()

const char* di_system_subarch_analyze | ( | void |  | ) |

Returns a string describing the current subarchitecture, e.g. "powermac_newworld".

{
char entry[256];
int i;
int ret;
/* If we detect EFI firmware, bail out early here */
if (di_system_is_efi())
return "efi";
entry[0] = '\0';
ret = read_dt_model(entry, sizeof(entry));
if (ret)
ret = read_cpuinfo(entry, sizeof(entry));
if (ret)
return "generic";
for (i = 0; map_hardware[i].entry; i++)
{
if (!strncasecmp(map_hardware[i].entry, entry,
strlen(map_hardware[i].entry)))
{
return( map_hardware[i].ret );
}
}
return "generic";
}
di_system_is_efi
int di_system_is_efi(void)
Definition: efi.c:27

References di_system_is_efi().

Referenced by di_system_subarch_analyze_guess().

## di_system_subarch_analyze_guess()

const char* di_system_subarch_analyze_guess | ( | void |  | ) |

Return a string with a best-guess of the current subarchitecture

Only present on armel currently, and is a stub on all other architectures

{
struct utsname sysinfo;
size_t uname_release_len, i;
/* If we detect EFI firmware, bail out early here */
if (di_system_is_efi())
return "efi";
/* Attempt to determine subarch based on kernel release version */
uname(&sysinfo);
uname_release_len = strlen(sysinfo.release);
for (i = 0; supported_generic_subarches[i] != NULL; i++)
{
size_t subarch_len = strlen (supported_generic_subarches[i]);
if (!strncmp(sysinfo.release+uname_release_len-subarch_len,
supported_generic_subarches[i],
subarch_len))
{
return supported_generic_subarches[i];
}
}
/* If we get here, try falling back on the normal detection method */
return di_system_subarch_analyze();
}
di_system_subarch_analyze
const char * di_system_subarch_analyze(void)
Definition: subarch-arm-linux.c:157

References di_system_is_efi(), and di_system_subarch_analyze().