File: print_loadaddr.c

package info (click to toggle)
arcboot 0.3.12
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 404 kB
  • ctags: 495
  • sloc: ansic: 2,401; makefile: 219; sh: 145
file content (30 lines) | stat: -rw-r--r-- 542 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* small helper to get the current subarch's loaddr */

#include <stdio.h>
#include <stdint.h>
#include <strings.h>

#include "subarch.h"

int main(int argc, char *argv[])
{
	int subarch = SUBARCH;

	if (argc == 2) {
		if (!strcasecmp(argv[1], "ip22"))
			subarch = IP22;
		else if (!strcasecmp(argv[1], "ip32"))
			subarch = IP32;
		else {
			fprintf(stderr,
				"Unknown subarchitecture %s requested\n",
				argv[1]);
			return 1;
		}
	}

	printf("%#08x\n", kernel_load[subarch].base
	       + kernel_load[subarch].reserved);

	return 0;
}