/*-
* Copyright (c) 1998 Robert Nordier
* All rights reserved.
* Copyright (c) 2001 Robert Drehmel
* All rights reserved.
*
* Redistribution and use in source and binary forms are freely
* permitted provided that the above copyright notice and this
* paragraph and the following disclaimer are duplicated in all
* such forms.
*
* This software is provided "AS IS" and without any express or
* implied warranties, including, without limitation, the implied
* warranties of merchantability and fitness for a particular
* purpose.
*/
__FBSDID("$FreeBSD$");
#include "paths.h"
struct sp_data {
char *sp_buf;
};
static void usage(void);
#ifdef ZFSBOOT
static void loadzfs(void);
#else
static void load(const char *);
#endif
/*
* Open Firmware interface functions
*/
static ofwh_t ofw_finddevice(const char *);
/*
* This has to stay here, as the PROM seems to ignore the
* entry point specified in the a.out header. (or elftoaout is broken)
*/
void
{
char *p;
int ac;
ac = 0;
p = bootargs;
for (;;) {
while (*p == ' ' && *p != '\0')
p++;
break;
while (*p != ' ' && *p != '\0')
p++;
if (*p != '\0')
*p++ = '\0';
}
}
static ofwh_t
{
(ofwcell_t)"finddevice",
1,
1,
0
};
return (1);
}
return (args[4]);
}
static int
{
(ofwcell_t)"getprop",
4,
1,
len,
0
};
printf("ofw_getprop: ofwh=0x%x buf=%p len=%u\n",
return (1);
}
return (0);
}
static ofwh_t
{
(ofwcell_t)"open",
1,
1,
0
};
return (-1);
}
return (args[4]);
}
static int
{
(ofwcell_t)"close",
1,
0,
};
return (1);
}
return (0);
}
static int
{
(ofwcell_t)"read",
3,
1,
len,
0
};
return (1);
}
return (0);
}
static int
{
(ofwcell_t)"write",
3,
1,
len,
0
};
return (1);
}
return (0);
}
static int
{
(ofwcell_t)"seek",
3,
1,
off >> 32,
off,
0
};
return (1);
}
return (0);
}
static void
ofw_exit(void)
{
args[1] = 0;
args[2] = 0;
for (;;)
}
static void
{
const char *s = src;
char *d = dst;
while (len-- != 0)
*d++ = *s++;
}
static void
{
}
static void
{
char *p = b;
while (len-- != 0)
*p++ = 0;
}
static int
{
;
}
int
{
const char *path;
int i;
path = PATH_LOADER;
for (i = 0; i < ac; i++) {
switch (av[i][0]) {
case '-':
switch (av[i][1]) {
default:
usage();
}
break;
default:
break;
}
}
#ifdef ZFSBOOT
bootpath);
#else
#endif
panic("domount");
#ifdef ZFSBOOT
loadzfs();
#else
#endif
return (1);
}
static void
usage(void)
{
exit(1);
}
static void
{
ofw_exit();
}
#ifdef ZFSBOOT
static int
{
char *p;
unsigned int nb;
unsigned int lb;
p = buf;
break;
else
p += len;
}
}
static void
loadzfs(void)
{
caddr_t p;
int i;
printf("Can't read elf header\n");
return;
}
printf("Not an ELF file\n");
return;
}
printf("Can't read program header %d\n", i);
return;
}
continue;
printf("Can't read content of section %d\n", i);
return;
}
}
}
#else
#include "ufsread.c"
static void
{
caddr_t p;
int i;
return;
}
printf("Can't read elf header\n");
return;
}
printf("Not an ELF file\n");
return;
}
printf("Can't read program header %d\n", i);
return;
}
continue;
printf("Can't read content of section %d\n", i);
return;
}
}
}
#endif /* ZFSBOOT */
static int
{
printf("domount: can't open device\n");
return (-1);
}
#ifndef ZFSBOOT
printf("domount: can't read superblock\n");
return (-1);
}
#endif
return (0);
}
static int
{
/*
* The Open Firmware should open the correct partition for us.
* That means, if we read from offset zero on an open instance handle,
* we should read from offset zero of that partition.
*/
return (0);
}
static void
{
exit(1);
}
static int
{
int ret;
return (ret);
}
static int
{
char buf;
if (c == '\n') {
buf = '\r';
}
buf = c;
return (1);
}
static int
{
int ret;
return (ret);
}
static int
{
int ret;
return (ret);
}
static int
{
char *nbuf;
int lflag;
int sflag;
char *s;
int pad;
int ret;
int c;
ret = 0;
while ((c = *fmt++) != 0) {
if (c != '%') {
continue;
}
lflag = 0;
sflag = 0;
pad = 0;
switch (c) {
case '#':
sflag = 1;
goto reswitch;
case '%':
break;
case 'c':
break;
case 'd':
if (lflag == 0) {
}
} else {
}
}
break;
case 'l':
lflag = 1;
goto reswitch;
case 'o':
if (lflag == 0) {
} else {
}
break;
case 'p':
break;
case 's':
break;
case 'u':
if (lflag == 0) {
} else {
}
break;
case 'x':
if (lflag == 0) {
} else {
}
if (sflag)
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
goto reswitch;
default:
break;
}
}
return (ret);
}
static int
{
return (1);
}
static int
{
const char *p;
int ret;
ret = 0;
for (p = s; *p != '\0'; p++)
return (ret);
}
static char *
{
char *p;
p = buf;
*p = '\0';
do
return (p);
}
static char *
{
char *p;
p = buf;
*p = '\0';
do
return (p);
}