Print this page
fakebop: use a memlist to keep track of physical memory
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/arm/sys/bootconf.h
+++ new/usr/src/uts/arm/sys/bootconf.h
1 1 /*
2 2 * This file and its contents are supplied under the terms of the
3 3 * Common Development and Distribution License ("CDDL"), version 1.0.
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
4 4 * You may only use this file in accordance with the terms of version
5 5 * 1.0 of the CDDL.
6 6 *
7 7 * A full copy of the text of the CDDL should have accompanied this
8 8 * source. A copy of the CDDL is also available via the Internet at
9 9 * http://www.illumos.org/license/CDDL.
10 10 */
11 11
12 12 /*
13 13 * Copyright (c) 2013 Joyent, Inc. All rights reserved.
14 + * Copyright (c) 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
14 15 */
15 16
16 17
17 18 #ifndef _SYS_BOOTCONF_H
18 19 #define _SYS_BOOTCONF_H
19 20
20 21 /*
21 22 * Boot time configuration information objects
22 23 */
23 24
24 25 #include <sys/types.h>
25 26 #include <sys/memlist.h>
26 27 #include <sys/ccompile.h>
27 28 #include <net/if.h> /* for IFNAMSIZ */
28 29
29 30 #ifdef __cplusplus
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
30 31 extern "C" {
31 32 #endif
32 33
33 34 /*
34 35 * Masks for bsys_alloc memory allocator. These overlap with the ones for intel
35 36 * and sun because they're used by the common kernel.
36 37 */
37 38 #define BO_NO_ALIGN 0x00001000
38 39 #define BO_ALIGN_DONTCARE -1
39 40
41 +struct bsys_mem {
42 + struct memlist physinstalled;
43 +};
44 +
40 45 #define BO_VERSION 1 /* bootops interface revision */
41 46
42 47 typedef struct bootops {
43 48 uint_t bsys_version;
49 + struct bsys_mem boot_mem;
44 50 caddr_t (*bsys_alloc)(struct bootops *, caddr_t, size_t, int);
45 51 void (*bsys_free)(struct bootops *, caddr_t, size_t);
46 52 int (*bsys_getproplen)(struct bootops *, const char *);
47 53 int (*bsys_getprop)(struct bootops *, const char *, void *);
48 54 void (*bsys_printf)(struct bootops *, const char *, ...);
49 55 } bootops_t;
50 56
51 57 #define BOP_GETVERSION(bop) ((bop)->bsys_version)
52 58 #define BOP_ALLOC(bop, virthint, size, align) \
53 59 ((bop)->bsys_alloc)(bop, virthint, size, align)
54 60 #define BOP_FREE(bop, virt, size) ((bop)->bsys_free)(bop, virt, size)
55 61 #define BOP_GETPROPLEN(bop, name) ((bop)->bsys_getproplen)(bop, name)
56 62 #define BOP_GETPROP(bop, name, buf) ((bop)->bsys_getprop)(bop, name, buf)
57 63 #define BOP_PUTSARG(bop, msg, arg) ((bop)->bsys_printf)(bop, msg, arg)
58 64
59 65 /*
60 66 * Boot configuration information
61 67 */
62 68
63 69 #define BO_MAXFSNAME 16
64 70 #define BO_MAXOBJNAME 256
65 71
66 72 struct bootobj {
67 73 char bo_fstype[BO_MAXFSNAME]; /* vfs type name (e.g. nfs) */
68 74 char bo_name[BO_MAXOBJNAME]; /* name of object */
69 75 int bo_flags; /* flags, see below */
70 76 int bo_size; /* number of blocks */
71 77 struct vnode *bo_vp; /* vnode of object */
72 78 char bo_devname[BO_MAXOBJNAME];
73 79 char bo_ifname[BO_MAXOBJNAME];
74 80 int bo_ppa;
75 81 };
76 82
77 83 /*
78 84 * flags
79 85 */
80 86 #define BO_VALID 0x01 /* all information in object is valid */
81 87 #define BO_BUSY 0x02 /* object is busy */
82 88
83 89 extern struct bootobj rootfs;
84 90 extern struct bootobj swapfile;
85 91
86 92 extern char *default_path;
87 93 extern int modrootloaded;
88 94 extern char kern_bootargs[];
89 95 extern char kern_bootfile[];
90 96
91 97 extern int strplumb(void);
92 98 extern char *strplumb_get_netdev_path(void);
93 99 extern void consconfig(void);
94 100 extern void release_bootstrap(void);
95 101
96 102 extern void bop_panic(const char *);
97 103 extern void boot_prop_finish(void);
98 104 extern void bop_printf(struct bootops *, const char *, ...);
99 105
100 106 extern struct bootops *bootops;
101 107 extern int netboot;
102 108 extern char *dhcack;
103 109 extern int dhcacklen;
104 110 extern char dhcifname[IFNAMSIZ];
105 111
106 112 extern char *netdev_path;
107 113
108 114 #ifdef __cplusplus
109 115 }
110 116 #endif
111 117
112 118 #endif /* _SYS_BOOTCONF_H */
↓ open down ↓ |
59 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX