vboot: replace sysincludes.h with 2sysincludes.h

sysincludes.h and 2sysincludes.h are almost identical except for
one extra header (ctype.h) in the vboot1 variant.  Add this to
2sysincludes.h, and nuke sysincludes.h.

Depends on: https://review.coreboot.org/c/coreboot/+/33525

BUG=b:124141368
TEST=make clean && make runtests
BRANCH=none

Change-Id: Iaba21a9b8bb2ae0c081184019576663898317bd1
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1680325
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1659990
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Auto-Submit: Joel Kitching <kitching@chromium.org>
diff --git a/firmware/2lib/include/2sysincludes.h b/firmware/2lib/include/2sysincludes.h
index 4c9e66c..792ece4 100644
--- a/firmware/2lib/include/2sysincludes.h
+++ b/firmware/2lib/include/2sysincludes.h
@@ -4,15 +4,16 @@
  */
 
 /*
- * System includes for vboot reference library.  With few exceptions, this is
- * the ONLY place in firmware/ where system headers may be included via
- * #include <...>, so that there's only one place that needs to be fixed up for
- * platforms which don't have all the system includes.
+ * System includes for vboot reference library.  This is the ONLY
+ * place in firmware/ where system headers may be included via
+ * #include <...>, so that there's only one place that needs to be
+ * fixed up for platforms which don't have all the system includes.
  */
 
 #ifndef VBOOT_REFERENCE_2_SYSINCLUDES_H_
 #define VBOOT_REFERENCE_2_SYSINCLUDES_H_
 
+#include <ctype.h>
 #include <inttypes.h>  /* For PRIu64 */
 #include <stddef.h>
 #include <stdint.h>
diff --git a/firmware/lib/cgptlib/cgptlib.c b/firmware/lib/cgptlib/cgptlib.c
index 0995b94..f8b3cb4 100644
--- a/firmware/lib/cgptlib/cgptlib.c
+++ b/firmware/lib/cgptlib/cgptlib.c
@@ -6,7 +6,6 @@
 #include "2sysincludes.h"
 #include "2common.h"
 
-#include "sysincludes.h"
 #include "cgptlib.h"
 #include "cgptlib_internal.h"
 #include "crc32.h"
diff --git a/firmware/lib/cgptlib/cgptlib_internal.c b/firmware/lib/cgptlib/cgptlib_internal.c
index 77a0de2..a29d253 100644
--- a/firmware/lib/cgptlib/cgptlib_internal.c
+++ b/firmware/lib/cgptlib/cgptlib_internal.c
@@ -3,7 +3,7 @@
  * found in the LICENSE file.
  */
 
-#include "sysincludes.h"
+#include "2sysincludes.h"
 
 #include "cgptlib.h"
 #include "cgptlib_internal.h"
diff --git a/firmware/lib/cgptlib/crc32.c b/firmware/lib/cgptlib/crc32.c
index 286cfa0..72f73fc 100644
--- a/firmware/lib/cgptlib/crc32.c
+++ b/firmware/lib/cgptlib/crc32.c
@@ -39,7 +39,7 @@
 /*      polynomial $edb88320                                              */
 /*                                                                        */
 /*  --------------------------------------------------------------------  */
-#include "sysincludes.h"
+#include "2sysincludes.h"
 
 #include "crc32.h"
 
diff --git a/firmware/lib/cgptlib/include/cgptlib.h b/firmware/lib/cgptlib/include/cgptlib.h
index df85494..93d15da 100644
--- a/firmware/lib/cgptlib/include/cgptlib.h
+++ b/firmware/lib/cgptlib/include/cgptlib.h
@@ -6,7 +6,7 @@
 #ifndef VBOOT_REFERENCE_CGPTLIB_H_
 #define VBOOT_REFERENCE_CGPTLIB_H_
 
-#include "sysincludes.h"
+#include "2sysincludes.h"
 #include "gpt_misc.h"
 
 /**
diff --git a/firmware/lib/cgptlib/include/cgptlib_internal.h b/firmware/lib/cgptlib/include/cgptlib_internal.h
index f19ef81..b9331b9 100644
--- a/firmware/lib/cgptlib/include/cgptlib_internal.h
+++ b/firmware/lib/cgptlib/include/cgptlib_internal.h
@@ -6,7 +6,7 @@
 #ifndef VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_
 #define VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_
 
-#include "sysincludes.h"
+#include "2sysincludes.h"
 #include "cgptlib.h"
 #include "gpt.h"
 
diff --git a/firmware/lib/cgptlib/include/crc32.h b/firmware/lib/cgptlib/include/crc32.h
index 2336113..e2825ce 100644
--- a/firmware/lib/cgptlib/include/crc32.h
+++ b/firmware/lib/cgptlib/include/crc32.h
@@ -5,7 +5,7 @@
 #ifndef VBOOT_REFERENCE_GPT_CRC32_H_
 #define VBOOT_REFERENCE_GPT_CRC32_H_
 
-#include "sysincludes.h"
+#include "2sysincludes.h"
 
 uint32_t Crc32(const void *buffer, uint32_t len);
 
diff --git a/firmware/lib/ec_sync.c b/firmware/lib/ec_sync.c
index 447bc84..719a8be 100644
--- a/firmware/lib/ec_sync.c
+++ b/firmware/lib/ec_sync.c
@@ -10,7 +10,6 @@
 #include "2misc.h"
 #include "2nvstorage.h"
 
-#include "sysincludes.h"
 #include "ec_sync.h"
 #include "vboot_api.h"
 #include "vboot_common.h"
diff --git a/firmware/lib/ec_sync_all.c b/firmware/lib/ec_sync_all.c
index 4a8cf67..467c330 100644
--- a/firmware/lib/ec_sync_all.c
+++ b/firmware/lib/ec_sync_all.c
@@ -10,7 +10,6 @@
 #include "2misc.h"
 #include "2nvstorage.h"
 
-#include "sysincludes.h"
 #include "ec_sync.h"
 #include "vboot_api.h"
 #include "vboot_common.h"
diff --git a/firmware/lib/gpt_misc.c b/firmware/lib/gpt_misc.c
index 4588583..3864643 100644
--- a/firmware/lib/gpt_misc.c
+++ b/firmware/lib/gpt_misc.c
@@ -6,7 +6,6 @@
 #include "2sysincludes.h"
 #include "2common.h"
 
-#include "sysincludes.h"
 #include "cgptlib.h"
 #include "cgptlib_internal.h"
 #include "crc32.h"
diff --git a/firmware/lib/include/rollback_index.h b/firmware/lib/include/rollback_index.h
index c5b119e..9d6cfcc 100644
--- a/firmware/lib/include/rollback_index.h
+++ b/firmware/lib/include/rollback_index.h
@@ -10,7 +10,7 @@
 #define VBOOT_REFERENCE_ROLLBACK_INDEX_H_
 
 #include "2return_codes.h"
-#include "sysincludes.h"
+#include "2sysincludes.h"
 #include "tss_constants.h"
 
 /* TPM NVRAM location indices. */
diff --git a/firmware/lib/include/sysincludes.h b/firmware/lib/include/sysincludes.h
deleted file mode 100644
index 28aa96c..0000000
--- a/firmware/lib/include/sysincludes.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* System includes for vboot reference library.  This is the ONLY
- * place in firmware/ where system headers may be included via
- * #include <...>, so that there's only one place that needs to be
- * fixed up for platforms which don't have all the system includes.
- *
- * Files in firmware/stub may still include system headers, because
- * they're local implementations and will be ported to each system
- * anyway. */
-
-#ifndef VBOOT_REFERENCE_SYSINCLUDES_H_
-#define VBOOT_REFERENCE_SYSINCLUDES_H_
-
-#include <ctype.h>
-#include <inttypes.h>  /* For PRIu64 */
-#include <stddef.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#if defined(HAVE_ENDIAN_H) && defined(HAVE_LITTLE_ENDIAN)
-#include <byteswap.h>
-#include <memory.h>
-#endif
-
-#endif  /* VBOOT_REFERENCE_SYSINCLUDES_H_ */
diff --git a/firmware/lib/include/utility.h b/firmware/lib/include/utility.h
index 272b9f4..879950b 100644
--- a/firmware/lib/include/utility.h
+++ b/firmware/lib/include/utility.h
@@ -12,7 +12,7 @@
 #define VBOOT_REFERENCE_UTILITY_H_
 
 #include "2common.h"
-#include "sysincludes.h"
+#include "2sysincludes.h"
 #include "vboot_api.h"
 
 #ifdef VBOOT_DEBUG
diff --git a/firmware/lib/mocked_rollback_index.c b/firmware/lib/mocked_rollback_index.c
index 6dfeb5c..4e8a74b 100644
--- a/firmware/lib/mocked_rollback_index.c
+++ b/firmware/lib/mocked_rollback_index.c
@@ -6,11 +6,8 @@
  * stored in the TPM NVRAM.
  */
 
-#include "sysincludes.h"
 #include "utility.h"
-
 #include "rollback_index.h"
-
 #include "tss_constants.h"
 
 
diff --git a/firmware/lib/tpm_lite/mocked_tlcl.c b/firmware/lib/tpm_lite/mocked_tlcl.c
index 917532d..d0dfb40 100644
--- a/firmware/lib/tpm_lite/mocked_tlcl.c
+++ b/firmware/lib/tpm_lite/mocked_tlcl.c
@@ -3,7 +3,7 @@
  * found in the LICENSE file.
  */
 
-#include "sysincludes.h"
+#include "2sysincludes.h"
 
 #include "tlcl.h"
 #include "tlcl_internal.h"
diff --git a/firmware/lib/tpm_lite/tlcl.c b/firmware/lib/tpm_lite/tlcl.c
index fac992f..d102f9b 100644
--- a/firmware/lib/tpm_lite/tlcl.c
+++ b/firmware/lib/tpm_lite/tlcl.c
@@ -19,7 +19,6 @@
 #include "2hmac.h"
 #include "2sha.h"
 
-#include "sysincludes.h"
 #include "tlcl.h"
 #include "tlcl_internal.h"
 #include "tlcl_structures.h"
diff --git a/firmware/lib/utility_string.c b/firmware/lib/utility_string.c
index 63e43c6..87b2293 100644
--- a/firmware/lib/utility_string.c
+++ b/firmware/lib/utility_string.c
@@ -5,7 +5,7 @@
  * String utility functions that need to be built as part of the firmware.
  */
 
-#include "sysincludes.h"
+#include "2sysincludes.h"
 
 #include "utility.h"
 
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 23ee6e8..ec9aaa1 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -5,8 +5,6 @@
  * High-level firmware wrapper API - entry points for kernel selection
  */
 
-#include "sysincludes.h"
-
 #include "2sysincludes.h"
 #include "2common.h"
 #include "2misc.h"
diff --git a/firmware/lib/vboot_audio.c b/firmware/lib/vboot_audio.c
index ba0f98c..d59b65b 100644
--- a/firmware/lib/vboot_audio.c
+++ b/firmware/lib/vboot_audio.c
@@ -9,7 +9,6 @@
 #include "2common.h"
 #include "2misc.h"
 
-#include "sysincludes.h"
 #include "utility.h"
 #include "vboot_api.h"
 #include "vboot_audio.h"
diff --git a/firmware/lib/vboot_common.c b/firmware/lib/vboot_common.c
index 8750045..b1c6d33 100644
--- a/firmware/lib/vboot_common.c
+++ b/firmware/lib/vboot_common.c
@@ -6,9 +6,7 @@
  * (Firmware portion)
  */
 
-#include "sysincludes.h"
 #include "2sysincludes.h"
-
 #include "2common.h"
 #include "2misc.h"
 #include "2rsa.h"
diff --git a/firmware/lib/vboot_common_init.c b/firmware/lib/vboot_common_init.c
index 44b3eb2..174f39c 100644
--- a/firmware/lib/vboot_common_init.c
+++ b/firmware/lib/vboot_common_init.c
@@ -9,7 +9,6 @@
 #include "2sysincludes.h"
 #include "2common.h"
 
-#include "sysincludes.h"
 #include "vboot_api.h"
 #include "vboot_common.h"
 #include "utility.h"
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
index 89ed694..52d3510 100644
--- a/firmware/lib/vboot_display.c
+++ b/firmware/lib/vboot_display.c
@@ -5,9 +5,7 @@
  * Display functions used in kernel selection.
  */
 
-#include "sysincludes.h"
 #include "2sysincludes.h"
-
 #include "2common.h"
 #include "2misc.h"
 #include "2nvstorage.h"
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c
index 85cc782..0d1545c 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -6,9 +6,7 @@
  * (Firmware portion)
  */
 
-#include "sysincludes.h"
 #include "2sysincludes.h"
-
 #include "2common.h"
 #include "2misc.h"
 #include "2nvstorage.h"
diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c
index 3bb1efa..88bbfb6 100644
--- a/firmware/lib/vboot_ui.c
+++ b/firmware/lib/vboot_ui.c
@@ -5,8 +5,6 @@
  * High-level firmware wrapper API - user interface for RW firmware
  */
 
-#include "sysincludes.h"
-
 #include "2sysincludes.h"
 #include "2common.h"
 #include "2misc.h"
diff --git a/firmware/lib/vboot_ui_common.c b/firmware/lib/vboot_ui_common.c
index be5d1f2..09c9607 100644
--- a/firmware/lib/vboot_ui_common.c
+++ b/firmware/lib/vboot_ui_common.c
@@ -5,8 +5,6 @@
  * High-level firmware wrapper API - user interface for RW firmware
  */
 
-#include "sysincludes.h"
-
 #include "2sysincludes.h"
 #include "2common.h"
 
diff --git a/firmware/linktest/main.c b/firmware/linktest/main.c
index 03195ed..75dda29 100644
--- a/firmware/linktest/main.c
+++ b/firmware/linktest/main.c
@@ -3,8 +3,7 @@
  * found in the LICENSE file.
  */
 
-#include "sysincludes.h"
-
+#include "2sysincludes.h"
 #include "cgptlib.h"
 #include "load_kernel_fw.h"
 #include "rollback_index.h"
diff --git a/tests/cgptlib_test.h b/tests/cgptlib_test.h
index 0f226bd..21ea6b9 100644
--- a/tests/cgptlib_test.h
+++ b/tests/cgptlib_test.h
@@ -6,7 +6,7 @@
 #define VBOOT_REFERENCE_CGPTLIB_TEST_H_
 
 #include <stdio.h>
-#include "sysincludes.h"
+#include "2sysincludes.h"
 
 enum {
 	TEST_FAIL = -1,
diff --git a/tests/tpm_lite/tlcl_tests.c b/tests/tpm_lite/tlcl_tests.c
index 353b16c..40b9888 100644
--- a/tests/tpm_lite/tlcl_tests.c
+++ b/tests/tpm_lite/tlcl_tests.c
@@ -6,7 +6,7 @@
 /* Shared code for tests.
  */
 
-#include "sysincludes.h"
+#include "2sysincludes.h"
 
 #include "tlcl.h"
 #include "tlcl_tests.h"
diff --git a/utility/tlcl_generator.c b/utility/tlcl_generator.c
index c021ed3..e34542b 100644
--- a/utility/tlcl_generator.c
+++ b/utility/tlcl_generator.c
@@ -12,11 +12,9 @@
  */
 
 #include <assert.h>
-#include <stddef.h>
 #include <stdio.h>
-#include <stdlib.h>
 
-#include "sysincludes.h"
+#include "2sysincludes.h"
 #include "tlcl_internal.h"
 #include "tpmextras.h"
 #include "tss_constants.h"