/****************************************************************************** * kernel.c * * Copyright (c) 2002-2005 K A Fraser */ #include #include #include #include #include #include #include #include #include #include #include #include #ifdef CONFIG_X86 #include #endif #ifndef COMPAT int tainted; void cmdline_parse(char *cmdline) { char opt[100], *optval, *q; const char *p = cmdline; struct kernel_param *param; if ( p == NULL ) return; /* Skip whitespace and the image name. */ while ( *p == ' ' ) p++; if ( (p = strchr(p, ' ')) == NULL ) return; for ( ; ; ) { /* Skip whitespace. */ while ( *p == ' ' ) p++; if ( *p == '\0' ) break; /* Grab the next whitespace-delimited option. */ q = opt; while ( (*p != ' ') && (*p != '\0') ) { if ( (q-opt) < (sizeof(opt)-1) ) /* avoid overflow */ *q++ = *p; p++; } *q = '\0'; /* Search for value part of a key=value option. */ optval = strchr(opt, '='); if ( optval != NULL ) *optval++ = '\0'; /* nul-terminate the option value */ else optval = q; /* default option value is empty string */ for ( param = &__setup_start; param <= &__setup_end; param++ ) { if ( strcmp(param->name, opt ) != 0 ) continue; switch ( param->type ) { case OPT_STR: strlcpy(param->var, optval, param->len); break; case OPT_UINT: *(unsigned int *)param->var = simple_strtol(optval, (const char **)&optval, 0); break; case OPT_BOOL: *(int *)param->var = 1; break; case OPT_CUSTOM: ((void (*)(const char *))param->var)(optval); break; } } } } /** * print_tainted - return a string to represent the kernel taint state. * * 'S' - SMP with CPUs not designed for SMP. * 'M' - Machine had a machine check experience. * 'B' - System has hit bad_page. * * The string is overwritten by the next call to print_taint(). */ char *print_tainted(char *str) { if ( tainted ) { snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c", tainted & TAINT_UNSAFE_SMP ? 'S' : ' ', tainted & TAINT_MACHINE_CHECK ? 'M' : ' ', tainted & TAINT_BAD_PAGE ? 'B' : ' ', tainted & TAINT_SYNC_CONSOLE ? 'C' : ' '); } else { snprintf(str, TAINT_STRING_MAX_LEN, "Not tainted"); } return str; } void add_taint(unsigned flag) { tainted |= flag; } # define DO(fn) long do_##fn #endif /* * Simple hypercalls. */ DO(xen_version)(int cmd, XEN_GUEST_HANDLE(void) arg) { switch ( cmd ) { case XENVER_version: { return (xen_major_version() << 16) | xen_minor_version(); } case XENVER_extraversion: { xen_extraversion_t extraversion; safe_strcpy(extraversion, xen_extra_version()); if ( copy_to_guest(arg, (char *)extraversion, sizeof(extraversion)) ) return -EFAULT; return 0; } case XENVER_compile_info:
hr.divider {
    margin-top: 5px;
    margin-bottom: 5px;
}