minor reformat
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1569 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
@@ -672,8 +672,8 @@ unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn,
|
|||||||
}
|
}
|
||||||
post_code(0x25);
|
post_code(0x25);
|
||||||
|
|
||||||
/* if the child provides scan_bus(), for example a bridge, scan the
|
/* if a child provides scan_bus(), for example a bridge, scan
|
||||||
* bus behind that child */
|
* buses behind that child */
|
||||||
for (child = bus->children; child; child = child->sibling) {
|
for (child = bus->children; child; child = child->sibling) {
|
||||||
if (!child->ops->scan_bus) {
|
if (!child->ops->scan_bus) {
|
||||||
continue;
|
continue;
|
||||||
|
@@ -17,20 +17,21 @@
|
|||||||
* For now we assume "zero" is 0xff
|
* For now we assume "zero" is 0xff
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void usage()
|
||||||
usage(){
|
{
|
||||||
fprintf(stderr, "Usage: buildrom <input> <output> <payload> ");
|
fprintf(stderr, "Usage: buildrom <input> <output> <payload> ");
|
||||||
fprintf(stderr, " <linuxbios-size> <total-size>\n");
|
fprintf(stderr, " <linuxbios-size> <total-size>\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void fatal(char *s)
|
||||||
fatal(char *s){
|
{
|
||||||
perror(s);
|
perror(s);
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
int
|
|
||||||
main(int argc, char *argv[]) {
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
int infd, payloadfd, outfd, size, insize, readlen, writelen, i;
|
int infd, payloadfd, outfd, size, insize, readlen, writelen, i;
|
||||||
int romsize;
|
int romsize;
|
||||||
unsigned char *cp;
|
unsigned char *cp;
|
||||||
@@ -40,7 +41,6 @@ main(int argc, char *argv[]) {
|
|||||||
if (argc != 6)
|
if (argc != 6)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
|
|
||||||
infd = open(argv[1], O_RDONLY);
|
infd = open(argv[1], O_RDONLY);
|
||||||
if (infd < 0)
|
if (infd < 0)
|
||||||
fatal(argv[1]);
|
fatal(argv[1]);
|
||||||
@@ -50,6 +50,7 @@ main(int argc, char *argv[]) {
|
|||||||
payloadfd = open(argv[3], O_RDONLY);
|
payloadfd = open(argv[3], O_RDONLY);
|
||||||
if (payloadfd < 0)
|
if (payloadfd < 0)
|
||||||
fatal(argv[3]);
|
fatal(argv[3]);
|
||||||
|
|
||||||
size = strtol(argv[4], 0, 0);
|
size = strtol(argv[4], 0, 0);
|
||||||
romsize = strtol(argv[5], 0, 0);
|
romsize = strtol(argv[5], 0, 0);
|
||||||
|
|
||||||
@@ -69,9 +70,9 @@ main(int argc, char *argv[]) {
|
|||||||
cp = malloc(romsize);
|
cp = malloc(romsize);
|
||||||
if (!cp)
|
if (!cp)
|
||||||
fatal("malloc buffer");
|
fatal("malloc buffer");
|
||||||
|
|
||||||
for (i = 0; i < romsize; i++)
|
for (i = 0; i < romsize; i++)
|
||||||
cp[i] = zero;
|
cp[i] = zero;
|
||||||
|
|
||||||
/* read the input file in at the END of the array */
|
/* read the input file in at the END of the array */
|
||||||
readlen = read(infd, &cp[romsize - inbuf.st_size], inbuf.st_size);
|
readlen = read(infd, &cp[romsize - inbuf.st_size], inbuf.st_size);
|
||||||
if (readlen < inbuf.st_size) {
|
if (readlen < inbuf.st_size) {
|
||||||
|
Reference in New Issue
Block a user