Memory can be statically allocated to a domain using the property "xen,static-
mem" defined in the domain configuration. The number of cells for the address
-and the size must be defined using respectively the properties
-"#xen,static-mem-address-cells" and "#xen,static-mem-size-cells".
+and the size must be defined respectively by the parent node properties
+"#address-cells" and "#size-cells".
The property 'memory' is still needed and should match the amount of memory
given to the guest. Currently, it either comes from static memory or lets Xen
/ {
chosen {
+ #address-cells = <0x1>;
+ #size-cells = <0x1>;
+ ...
domU1 {
compatible = "xen,domain";
- #address-cells = <0x2>;
- #size-cells = <0x2>;
cpus = <2>;
memory = <0x0 0x80000>;
- #xen,static-mem-address-cells = <0x1>;
- #xen,static-mem-size-cells = <0x1>;
xen,static-mem = <0x30000000 0x20000000>;
...
};
/ {
chosen {
+ #address-cells = <0x1>;
+ #size-cells = <0x1>;
+ ...
domU1 {
compatible = "xen,domain";
- #address-cells = <0x2>;
- #size-cells = <0x2>;
cpus = <2>;
memory = <0x0 0x80000>;
- #xen,static-mem-address-cells = <0x1>;
- #xen,static-mem-size-cells = <0x1>;
xen,static-mem = <0x30000000 0x20000000>;
direct-map;
...
/* No "xen,static-mem" present. */
return 0;
- address_cells = device_tree_get_u32(fdt, node,
- "#xen,static-mem-address-cells", 0);
- size_cells = device_tree_get_u32(fdt, node,
- "#xen,static-mem-size-cells", 0);
-
return device_tree_get_meminfo(fdt, node, "xen,static-mem", address_cells,
size_cells, &bootinfo.reserved_mem,
MEMBANK_STATIC_DOMAIN);
const struct dt_property *prop;
prop = dt_find_property(node, "xen,static-mem", NULL);
- if ( !dt_property_read_u32(node, "#xen,static-mem-address-cells",
- addr_cells) )
- {
- printk(XENLOG_ERR
- "failed to read \"#xen,static-mem-address-cells\".\n");
- return -EINVAL;
- }
- if ( !dt_property_read_u32(node, "#xen,static-mem-size-cells",
- size_cells) )
- {
- printk(XENLOG_ERR
- "failed to read \"#xen,static-mem-size-cells\".\n");
- return -EINVAL;
- }
+ *addr_cells = dt_n_addr_cells(node);
+ *size_cells = dt_n_size_cells(node);
*cell = (const __be32 *)prop->value;
*length = prop->length;