libpayload: Provide dummy getenv()
[coreboot.git] / payloads / libpayload / libc / lib.c
index e7eed68eb6cc485448c7cd251786b0fe56d15317..616a7c6ca7628e6a5218833513b9648b53117b61 100644 (file)
@@ -54,7 +54,7 @@ int dec2bcd(int d)
 /**
  * Return the absolute value of the specified integer.
  *
- * @param val The integer of which we want to know the absolute value.
+ * @param j The integer of which we want to know the absolute value.
  * @return The absolute value of the specified integer.
  */
 int abs(int j)
@@ -101,3 +101,28 @@ u8 hex2bin(u8 h)
                ('A' <= h && h <= 'F') ? (h - 'A' + 10) : \
                ('a' <= h && h <= 'f') ? (h - 'a' + 10) : 0);
 }
+
+/**
+ * Enters HALT state, after printing msg
+ *
+ * @param msg message to print
+ */
+void fatal(const char *msg)
+{
+       fprintf(stderr, "%s",msg);
+       halt();
+}
+
+void exit(int status)
+{
+       printf("exited with status %d\n", status);
+       halt();
+}
+
+int errno;
+
+char *getenv(const char *name)
+{
+       return NULL;
+}
+