Deleted Added
full compact
main.c (332152) main.c (332154)
1/*-
2 * Copyright (c) 2000 Benno Rice <benno@jeamland.net>
3 * Copyright (c) 2000 Stephane Potvin <sepotvin@videotron.ca>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000 Benno Rice <benno@jeamland.net>
3 * Copyright (c) 2000 Stephane Potvin <sepotvin@videotron.ca>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: stable/11/stand/powerpc/ofw/main.c 332152 2018-04-06 20:27:55Z kevans $");
29__FBSDID("$FreeBSD: stable/11/stand/powerpc/ofw/main.c 332154 2018-04-06 21:37:25Z kevans $");
30
31#include <stand.h>
32#include "openfirm.h"
33#include "libofw.h"
34#include "bootstrap.h"
35
36#include <machine/psl.h>
37
38struct arch_switch archsw; /* MI/MD interface boundary */
39
40extern char end[];
41extern char bootprog_info[];
42
30
31#include <stand.h>
32#include "openfirm.h"
33#include "libofw.h"
34#include "bootstrap.h"
35
36#include <machine/psl.h>
37
38struct arch_switch archsw; /* MI/MD interface boundary */
39
40extern char end[];
41extern char bootprog_info[];
42
43u_int32_t acells, scells;
43uint32_t acells, scells;
44
45static char bootargs[128];
46
47#define HEAP_SIZE 0x800000
48static char heap[HEAP_SIZE]; // In BSS, so uses no space
49
50#define OF_puts(fd, text) OF_write(fd, text, strlen(text))
51

--- 16 unchanged lines hidden (view full) ---

68}
69
70uint64_t
71memsize(void)
72{
73 phandle_t memoryp;
74 cell_t reg[24];
75 int i, sz;
44
45static char bootargs[128];
46
47#define HEAP_SIZE 0x800000
48static char heap[HEAP_SIZE]; // In BSS, so uses no space
49
50#define OF_puts(fd, text) OF_write(fd, text, strlen(text))
51

--- 16 unchanged lines hidden (view full) ---

68}
69
70uint64_t
71memsize(void)
72{
73 phandle_t memoryp;
74 cell_t reg[24];
75 int i, sz;
76 u_int64_t memsz;
76 uint64_t memsz;
77
78 memsz = 0;
79 memoryp = OF_instance_to_package(memory);
80
81 sz = OF_getprop(memoryp, "reg", &reg, sizeof(reg));
82 sz /= sizeof(reg[0]);
83
84 for (i = 0; i < sz; i += (acells + scells)) {

--- 116 unchanged lines hidden ---
77
78 memsz = 0;
79 memoryp = OF_instance_to_package(memory);
80
81 sz = OF_getprop(memoryp, "reg", &reg, sizeof(reg));
82 sz /= sizeof(reg[0]);
83
84 for (i = 0; i < sz; i += (acells + scells)) {

--- 116 unchanged lines hidden ---