[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v3 1/7] plat: Implement tls stub for arm64



Without this patch, compiler will report:
unikraft/plat/common/include/tls.h:38:2: error: #error "For thread-local
storage support, add tls.h for current architecture."
 #error "For thread-local storage support, add tls.h for current architecture."
And arm64 kvm plat target will not be built.

Now I don't remove the pre-compilation #warn as follows in
arch/arm/arm64/include/uk/asm/tls.h because I thought arm64 tls implementation
should use tpidr_el1. I will do it in the future.
"#warning Thread-local storage has not been tested on aarch64!"

Signed-off-by: Jia He <justin.he@xxxxxxx>
---
 plat/common/include/arm/arm64/tls.h | 37 +++++++++++++++++++++++++++++
 plat/common/include/tls.h           |  2 ++
 2 files changed, 39 insertions(+)
 create mode 100644 plat/common/include/arm/arm64/tls.h

diff --git a/plat/common/include/arm/arm64/tls.h 
b/plat/common/include/arm/arm64/tls.h
new file mode 100644
index 0000000..ed92ab9
--- /dev/null
+++ b/plat/common/include/arm/arm64/tls.h
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Copyright (c) 2019, NEC Europe Ltd., NEC Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
+ */
+#ifndef __PLAT_CMN_ARM64_TLS_H__
+#define __PLAT_CMN_ARM64_TLS_H__
+
+#define set_tls_pointer(ptr) do { } while (0)
+
+#endif /* __PLAT_CMN_X86_TLS_H__ */
diff --git a/plat/common/include/tls.h b/plat/common/include/tls.h
index b9176f9..45659d8 100644
--- a/plat/common/include/tls.h
+++ b/plat/common/include/tls.h
@@ -34,6 +34,8 @@
 
 #if defined(__X86_64__)
 #include <x86/tls.h>
+#elif defined(__ARM_64__)
+#include <arm/arm64/tls.h>
 #else
 #error "For thread-local storage support, add tls.h for current architecture."
 #endif
-- 
2.17.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.