fakebop.c revision 2baa66a090105c68f5f57d75153a2aaafdbe8536
3373N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3373N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
#ifdef __xpv
#include "acpi_fw.h"
#define PUT_STRING(s) { \
char *cp; \
* stuff to store/report/manipulate boot property settings.
typedef struct bootprop {
char *bp_name;
char *bp_value;
} bootprop_t;
#ifdef __xpv
static void build_firmware_properties(void);
#ifdef __xpv
int fastreboot_capable = 0;
int force_fastreboot = 0;
int post_fastreboot = 0;
int force_fastreboot = 0;
int post_fastreboot = 0;
int saved_cmdline_len = 0;
* Be careful if high memory usage is limited in startup.c
#if defined(__i386)
if (early_allocation) {
if (pa != 0) {
if (early_allocation)
return (pa);
static uintptr_t
return (rv);
static caddr_t
if (a < MMU_PAGESIZE)
a = MMU_PAGESIZE;
else if (!ISP2(a))
s = size;
s >= pgsize) {
s -= pgsize;
level = 0;
s -= pgsize;
return (virthint);
static caddr_t
int align,
int flags)
bootprop_t *b;
bprops = b;
*curr_page++ = 0;
if (vlen > 0) {
++curr_page;
--curr_space;
bootprop_t *b;
return (b->bp_vlen);
bootprop_t *b;
bootprop_t *b;
return (NULL);
b = b->bp_next;
if (b == NULL)
return (NULL);
return (b->bp_name);
return (NULL);
int adjust = 0;
int digit;
*retval = 0;
adjust = *p++;
* - values from /boot/solaris/bootenv.rc (ie. eeprom(1m) values)
boot_prop_finish(void)
int fd;
char *line;
int bytes_read;
char *name;
int n_len;
char *value;
int v_len;
char *outputdev;
char *consoledev;
int use_xencons = 0;
#ifdef __xpv
while (fd >= 0) {
if (bytes_read == 0) {
goto done;
line[c] = 0;
if (line[c] == 0)
n_len = 0;
++n_len, ++c;
v_len = 0;
if (line[c] != 0) {
++v_len, ++c;
++value;
if (v_len > 0)
done:
if (fd >= 0)
early_allocation = 0;
if (!use_xencons) {
if (v_len > 0)
v_len = 0;
if (v_len > 0)
v_len = 0;
if (v_len > 0)
v_len = 0;
if (v_len < 0)
if (have_console == 0)
(void) bcons_getchar();
pc_reset();
typedef struct bios_regs {
} bios_regs_t;
#if defined(__xpv)
if (firsttime) {
extern char bios_image[];
firsttime = 0;
static char *whoami;
#if defined(__xpv)
cp++;
cp++;
prop_name++;
n_prop--;
} while (n_prop > 0);
xen_vbdroot_props(char *s)
char *pnp;
char *prop_p;
char mi;
short minor;
long addr = 0;
prop_p++;
prop_p++;
minor = 0;
xen_nfsroot_props(char *s)
char *prop_map[] = {
xen_ip_props(char *s)
char *prop_map[] = {
* - values from /boot/solaris/bootenv.rc (ie. eeprom(1m) values)
build_boot_properties(void)
char *name;
int name_len;
char *value;
int value_len;
char *propbuf;
int quoted = 0;
int boot_arg_len;
#ifndef __xpv
static int stdout_val = 0;
int netboot;
boot_args[0] = 0;
boot_arg_len = 0;
#ifndef __xpv
fastreboot_capable = 0;
#ifdef __xpv
++value;
value++;
value_len = 0;
value++;
++value_len;
++value;
value_len = 0;
++value_len;
if (value_len > 0) {
while (*name != 0) {
++name;
++name;
++value;
value_len = 0;
quoted = 0;
for (; ; ++value_len) {
if (value_len == 0 &&
++value_len;
if (quoted) {
quoted = 0;
if (value_len == 0) {
char *v = value;
int l = value_len;
++name;
#ifndef __xpv
netboot = 0;
fastreboot_capable = 0;
fastreboot_capable = 0;
netboot++;
#if defined(__xpv)
#ifdef __xpv
relocate_boot_archive(void)
int slop;
int total = 0;
int relocated = 0;
int mmu_update_return;
if (slop) {
while (len != 0) {
++total;
++relocated;
#if !defined(__xpv)
#ifdef __amd64
typedef struct bop_frame {
} bop_frame_t;
int cnt;
char *ksym;
if (pc == 0)
if (ksym)
if (frame == 0) {
#if defined(__i386)
struct trapframe {
#ifdef __amd64
static int depth = 0;
#ifdef __amd64
extern void bop_trap_handler(void);
bop_idt_init(void)
for (t = 0; t < NIDT; ++t) {
extern void _kobj_boot();
#ifdef __xpv
#ifndef __xpv
#ifdef __xpv
#ifdef __xpv
#ifndef __xpv
bop_idt_init();
char *name;
char *value;
char *cp;
int len;
static caddr_t
return (NULL);
bop_no_more_mem(void)
#ifndef __xpv
static caddr_t
static uint8_t
while (len-- > 0)
return (sum);
static struct rsdp *
while (len > 0) {
return (NULL);
static struct rsdp *
find_rsdp() {
return (rsdp);
static struct table_header *
return (tp);
static struct table_header *
static int revision = 0;
static int len;
return (NULL);
if (revision == 0) {
switch (revision) {
if (xsdt_addr != 0)
revision = 0;
if (revision == 0)
return (NULL);
for (n = 0; n < len; n++) {
if (table_addr == 0)
return (tp);
return (NULL);
cpu_count++;
} processor;
} x2apic;
} memory;
#pragma pack()
case SRAT_PROCESSOR:
proc_num);
sizeof (processor));
proc_num++;
case SRAT_MEMORY:
mem_num);
sizeof (memory));
mem_num++;
case SRAT_X2APIC:
proc_num);
sizeof (x2apic));
proc_num++;
max_id = 0;
#ifndef __xpv
static char *p = NULL;
int boot_prop_len;
if (prop_value)