These changes are the raw update to qemu-2.6.
[kvmfornfv.git] / qemu / roms / SLOF / lib / libnvram / nvram.c
index 5c11376..473814e 100644 (file)
@@ -358,6 +358,17 @@ partition_t get_partition(unsigned int type, char *name)
        return ret;
 }
 
+/* Get partition specified by a Forth string */
+partition_t get_partition_fs(char *name, int namelen)
+{
+       char buf[namelen + 1];
+
+       memcpy(buf, name, namelen);
+       buf[namelen] = 0;
+
+       return get_partition(-1, buf);
+}
+
 void erase_nvram(int offset, int len)
 {
        int i;
@@ -466,6 +477,22 @@ partition_t new_nvram_partition(int type, char *name, int len)
        return new_part;
 }
 
+partition_t new_nvram_partition_fs(int type, char *name, int namelen, int len)
+{
+       char buf[13];
+       int i;
+
+       for (i = 0; i < 12; i++) {
+               if (i < namelen)
+                       buf[i] = name[i];
+               else
+                       buf[i] = 0;
+       }
+       buf[12] = 0;
+
+       return new_nvram_partition(type, buf, len);
+}
+
 /**
  * @param partition   partition structure pointing to the partition to wipe.
  */