libc: Fix all includes in codebase

The codebase was using non-standard headers. It is needed to replace
them by the correct ones so that we can use the new libc headers.

Change-Id: I530f71d9510cb036e69fe79823c8230afe890b9d
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
diff --git a/include/lib/aarch32/arch_helpers.h b/include/lib/aarch32/arch_helpers.h
index aa68bcb..8eda5cb 100644
--- a/include/lib/aarch32/arch_helpers.h
+++ b/include/lib/aarch32/arch_helpers.h
@@ -8,8 +8,9 @@
 #define __ARCH_HELPERS_H__
 
 #include <arch.h>	/* for additional register definitions */
+#include <cdefs.h>
 #include <stdint.h>
-#include <sys/types.h>
+#include <string.h>
 
 /**********************************************************************
  * Macros which create inline functions to read or write CPU system
diff --git a/include/lib/aarch32/smccc_helpers.h b/include/lib/aarch32/smccc_helpers.h
index 731c26f..d6e525f 100644
--- a/include/lib/aarch32/smccc_helpers.h
+++ b/include/lib/aarch32/smccc_helpers.h
@@ -26,7 +26,7 @@
 
 #ifndef __ASSEMBLY__
 #include <cassert.h>
-#include <types.h>
+#include <stdint.h>
 
 /*
  * The generic structure to save arguments and callee saved registers during
diff --git a/include/lib/aarch64/arch_helpers.h b/include/lib/aarch64/arch_helpers.h
index 8e82dbd..067c374 100644
--- a/include/lib/aarch64/arch_helpers.h
+++ b/include/lib/aarch64/arch_helpers.h
@@ -10,7 +10,7 @@
 #include <arch.h>	/* for additional register definitions */
 #include <cdefs.h>	/* For __dead2 */
 #include <stdint.h>
-#include <sys/types.h>
+#include <string.h>
 
 /**********************************************************************
  * Macros which create inline functions to read or write CPU system
diff --git a/include/lib/bakery_lock.h b/include/lib/bakery_lock.h
index d4645c3..c80082e 100644
--- a/include/lib/bakery_lock.h
+++ b/include/lib/bakery_lock.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -12,6 +12,7 @@
 #define BAKERY_LOCK_MAX_CPUS		PLATFORM_CORE_COUNT
 
 #ifndef __ASSEMBLY__
+#include <cdefs.h>
 #include <stdint.h>
 
 /*****************************************************************************
diff --git a/include/lib/cassert.h b/include/lib/cassert.h
index 40cb483..3119e1f 100644
--- a/include/lib/cassert.h
+++ b/include/lib/cassert.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -7,6 +7,8 @@
 #ifndef __CASSERT_H__
 #define __CASSERT_H__
 
+#include <cdefs.h>
+
 /*******************************************************************************
  * Macro to flag a compile time assertion. It uses the preprocessor to generate
  * an invalid C construct if 'cond' evaluates to false.
diff --git a/include/lib/coreboot.h b/include/lib/coreboot.h
index 4b1f200..f8fbd93 100644
--- a/include/lib/coreboot.h
+++ b/include/lib/coreboot.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -7,7 +7,7 @@
 #ifndef __COREBOOT_H__
 #define __COREBOOT_H__
 
-#include <types.h>
+#include <stdint.h>
 
 typedef struct {
 	uint32_t type;			/* always 2 (memory-mapped) on ARM */
diff --git a/include/lib/extensions/amu.h b/include/lib/extensions/amu.h
index 559c8f1..46d5e15 100644
--- a/include/lib/extensions/amu.h
+++ b/include/lib/extensions/amu.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -10,7 +10,6 @@
 #include <cassert.h>
 #include <platform_def.h>
 #include <stdint.h>
-#include <sys/cdefs.h> /* for CASSERT() */
 
 /* All group 0 counters */
 #define AMU_GROUP0_COUNTERS_MASK	0xf
diff --git a/include/lib/psci/psci.h b/include/lib/psci/psci.h
index 71d605d..fa0da9f 100644
--- a/include/lib/psci/psci.h
+++ b/include/lib/psci/psci.h
@@ -171,7 +171,6 @@
 #ifndef __ASSEMBLY__
 
 #include <stdint.h>
-#include <types.h>
 
 /* Function to help build the psci capabilities bitfield */
 
diff --git a/include/lib/psci/psci_lib.h b/include/lib/psci/psci_lib.h
index 5b30f55..134cad9 100644
--- a/include/lib/psci/psci_lib.h
+++ b/include/lib/psci/psci_lib.h
@@ -10,7 +10,8 @@
 #include <ep_info.h>
 
 #ifndef __ASSEMBLY__
-#include <types.h>
+#include <cdefs.h>
+#include <stdint.h>
 
 /*******************************************************************************
  * Optional structure populated by the Secure Payload Dispatcher to be given a
diff --git a/include/lib/spinlock.h b/include/lib/spinlock.h
index a7b0d39..8aec707 100644
--- a/include/lib/spinlock.h
+++ b/include/lib/spinlock.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -9,7 +9,7 @@
 
 #ifndef __ASSEMBLY__
 
-#include <types.h>
+#include <stdint.h>
 
 typedef struct spinlock {
 	volatile uint32_t lock;
diff --git a/include/lib/utils.h b/include/lib/utils.h
index 5f13e99..09ec8d9 100644
--- a/include/lib/utils.h
+++ b/include/lib/utils.h
@@ -17,7 +17,7 @@
  */
 #if !(defined(__LINKER__) || defined(__ASSEMBLY__))
 
-#include <types.h>
+#include <stdint.h>
 
 typedef struct mem_region {
 	uintptr_t base;
diff --git a/include/lib/xlat_tables/xlat_mmu_helpers.h b/include/lib/xlat_tables/xlat_mmu_helpers.h
index e1d0227..ab491e3 100644
--- a/include/lib/xlat_tables/xlat_mmu_helpers.h
+++ b/include/lib/xlat_tables/xlat_mmu_helpers.h
@@ -54,7 +54,7 @@
 
 #include <stdbool.h>
 #include <stdint.h>
-#include <sys/types.h>
+#include <string.h>
 
 /*
  * Return the values that the MMU configuration registers must contain for the