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

[Xen-devel] [PATCH v8 1/7] xen: add assembly variables corresponding to linker symbols



Allocate one assembly variable for each linker symbol to be used from C.
Next patches will make use of these variables, by replacing the usage of
the corresponding linker symbols group by group.

The new variables are intended to be integer types (uintptr_t), not
pointers, to avoid comparisons and subtractions between pointers
pointing to different objects.

Signed-off-by: Stefano Stabellini <stefanos@xxxxxxxxxx>
---
Changes in v8:
- new patch
---
 xen/arch/arm/arm32/Makefile  |  1 +
 xen/arch/arm/arm32/var.S     | 72 ++++++++++++++++++++++++++++++++++
 xen/arch/arm/arm64/Makefile  |  1 +
 xen/arch/arm/arm64/var.S     | 72 ++++++++++++++++++++++++++++++++++
 xen/arch/x86/x86_64/Makefile |  1 +
 xen/arch/x86/x86_64/var.S    | 92 ++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 239 insertions(+)
 create mode 100644 xen/arch/arm/arm32/var.S
 create mode 100644 xen/arch/arm/arm64/var.S
 create mode 100644 xen/arch/x86/x86_64/var.S

diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile
index 0ac254f..983fb82 100644
--- a/xen/arch/arm/arm32/Makefile
+++ b/xen/arch/arm/arm32/Makefile
@@ -10,4 +10,5 @@ obj-y += proc-v7.o proc-caxx.o
 obj-y += smpboot.o
 obj-y += traps.o
 obj-y += vfp.o
+obj-y += var.o
 
diff --git a/xen/arch/arm/arm32/var.S b/xen/arch/arm/arm32/var.S
new file mode 100644
index 0000000..69e5b04
--- /dev/null
+++ b/xen/arch/arm/arm32/var.S
@@ -0,0 +1,72 @@
+GLOBAL(start_)
+  .long  _start
+GLOBAL(end_)
+  .long  _end
+GLOBAL(init_begin_)
+  .long __init_begin
+GLOBAL(init_end_)
+  .long __init_end
+GLOBAL(stext_)
+  .long _stext
+GLOBAL(etext_)
+  .long _etext
+GLOBAL(alt_instructions_)
+  .long __alt_instructions
+GLOBAL(alt_instructions_end_)
+  .long __alt_instructions_end
+GLOBAL(per_cpu_start_)
+  .long __per_cpu_start
+GLOBAL(per_cpu_data_end_)
+  .long __per_cpu_data_end
+GLOBAL(splatform_)
+  .long _splatform
+GLOBAL(eplatform_)
+  .long _eplatform
+GLOBAL(sdevice_)
+  .long _sdevice
+GLOBAL(edevice_)
+  .long _edevice
+GLOBAL(asdevice_)
+  .long _asdevice
+GLOBAL(aedevice_)
+  .long _aedevice
+GLOBAL(srodata_)
+  .long _srodata
+GLOBAL(erodata_)
+  .long _erodata
+GLOBAL(sinittext_)
+  .long _sinittext
+GLOBAL(einittext_)
+  .long _einittext
+GLOBAL(note_gnu_build_id_start_)
+  .long __note_gnu_build_id_start
+GLOBAL(note_gnu_build_id_end_)
+  .long __note_gnu_build_id_end
+#ifdef CONFIG_LOCK_PROFILE
+GLOBAL(lock_profile_start_)
+  .long __lock_profile_start
+GLOBAL(lock_profile_end_)
+  .long __lock_profile_end
+#endif
+GLOBAL(initcall_start_)
+  .long __initcall_start
+GLOBAL(initcall_end_)
+  .long __initcall_end
+GLOBAL(presmp_initcall_end_)
+  .long __presmp_initcall_end
+GLOBAL(ctors_start_)
+  .long __ctors_start
+GLOBAL(ctors_end_)
+  .long __ctors_end
+GLOBAL(end_schedulers_array_)
+  .long __end_schedulers_array
+GLOBAL(start_schedulers_array_)
+  .long __start_schedulers_array
+GLOBAL(start_bug_frames_)
+  .long __start_bug_frames
+GLOBAL(stop_bug_frames_0_)
+  .long __stop_bug_frames_0
+GLOBAL(stop_bug_frames_1_)
+  .long __stop_bug_frames_1
+GLOBAL(stop_bug_frames_2_)
+  .long __stop_bug_frames_2
diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
index c4f3a28..a5d9558 100644
--- a/xen/arch/arm/arm64/Makefile
+++ b/xen/arch/arm/arm64/Makefile
@@ -13,3 +13,4 @@ obj-y += smpboot.o
 obj-y += traps.o
 obj-y += vfp.o
 obj-y += vsysreg.o
+obj-y += var.o
diff --git a/xen/arch/arm/arm64/var.S b/xen/arch/arm/arm64/var.S
new file mode 100644
index 0000000..30ef0c2
--- /dev/null
+++ b/xen/arch/arm/arm64/var.S
@@ -0,0 +1,72 @@
+GLOBAL(start_)
+  .quad  _start
+GLOBAL(end_)
+  .quad  _end
+GLOBAL(init_begin_)
+  .quad __init_begin
+GLOBAL(init_end_)
+  .quad __init_end
+GLOBAL(stext_)
+  .quad _stext
+GLOBAL(etext_)
+  .quad _etext
+GLOBAL(alt_instructions_)
+  .quad __alt_instructions
+GLOBAL(alt_instructions_end_)
+  .quad __alt_instructions_end
+GLOBAL(per_cpu_start_)
+  .quad __per_cpu_start
+GLOBAL(per_cpu_data_end_)
+  .quad __per_cpu_data_end
+GLOBAL(splatform_)
+  .quad _splatform
+GLOBAL(eplatform_)
+  .quad _eplatform
+GLOBAL(sdevice_)
+  .quad _sdevice
+GLOBAL(edevice_)
+  .quad _edevice
+GLOBAL(asdevice_)
+  .quad _asdevice
+GLOBAL(aedevice_)
+  .quad _aedevice
+GLOBAL(srodata_)
+  .quad _srodata
+GLOBAL(erodata_)
+  .quad _erodata
+GLOBAL(sinittext_)
+  .quad _sinittext
+GLOBAL(einittext_)
+  .quad _einittext
+GLOBAL(note_gnu_build_id_start_)
+  .quad __note_gnu_build_id_start
+GLOBAL(note_gnu_build_id_end_)
+  .quad __note_gnu_build_id_end
+#ifdef CONFIG_LOCK_PROFILE
+GLOBAL(lock_profile_start_)
+  .quad __lock_profile_start
+GLOBAL(lock_profile_end_)
+  .quad __lock_profile_end
+#endif
+GLOBAL(initcall_start_)
+  .quad __initcall_start
+GLOBAL(initcall_end_)
+  .quad __initcall_end
+GLOBAL(presmp_initcall_end_)
+  .quad __presmp_initcall_end
+GLOBAL(ctors_start_)
+  .quad __ctors_start
+GLOBAL(ctors_end_)
+  .quad __ctors_end
+GLOBAL(end_schedulers_array_)
+  .quad __end_schedulers_array
+GLOBAL(start_schedulers_array_)
+  .quad __start_schedulers_array
+GLOBAL(start_bug_frames_)
+  .quad __start_bug_frames
+GLOBAL(stop_bug_frames_0_)
+  .quad __stop_bug_frames_0
+GLOBAL(stop_bug_frames_1_)
+  .quad __stop_bug_frames_1
+GLOBAL(stop_bug_frames_2_)
+  .quad __stop_bug_frames_2
diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile
index 4bfa148..e9a94cb 100644
--- a/xen/arch/x86/x86_64/Makefile
+++ b/xen/arch/x86/x86_64/Makefile
@@ -1,6 +1,7 @@
 subdir-$(CONFIG_PV) += compat
 
 obj-bin-y += entry.o
+obj-bin-y += var.o
 obj-y += traps.o
 obj-$(CONFIG_KEXEC) += machine_kexec.o
 obj-y += pci.o
diff --git a/xen/arch/x86/x86_64/var.S b/xen/arch/x86/x86_64/var.S
new file mode 100644
index 0000000..6da54a5
--- /dev/null
+++ b/xen/arch/x86/x86_64/var.S
@@ -0,0 +1,92 @@
+GLOBAL(start_)
+  .quad  _start
+GLOBAL(end_)
+  .quad  _end
+GLOBAL(rwdata_start_2M_)
+  .quad __2M_rwdata_start
+GLOBAL(rwdata_end_2M_)
+  .quad __2M_rwdata_end 
+GLOBAL(rodata_start_2M_)
+  .quad __2M_rodata_start
+GLOBAL(rodata_end_2M_)
+  .quad __2M_rodata_end 
+GLOBAL(text_end_2M_)
+  .quad __2M_text_end 
+GLOBAL(init_start_2M_)
+  .quad __2M_init_start
+GLOBAL(init_end_2M_)
+  .quad __2M_init_end 
+GLOBAL(init_begin_)
+  .quad __init_begin
+GLOBAL(init_end_)
+  .quad __init_end
+GLOBAL(stext_)
+  .quad _stext
+GLOBAL(etext_)
+  .quad _etext
+GLOBAL(alt_instructions_)
+  .quad __alt_instructions
+GLOBAL(alt_instructions_end_)
+  .quad __alt_instructions_end
+GLOBAL(end_vpci_array_)
+  .quad __end_vpci_array
+GLOBAL(start_vpci_array_)
+  .quad __start_vpci_array
+GLOBAL(stextentry_)
+  .quad _stextentry 
+GLOBAL(etextentry_)
+  .quad _etextentry 
+GLOBAL(trampoline_rel_start_)
+  .quad __trampoline_rel_start 
+GLOBAL(trampoline_rel_stop_)
+  .quad __trampoline_rel_stop 
+GLOBAL(trampoline_seg_start_)
+  .quad __trampoline_seg_start 
+GLOBAL(trampoline_seg_stop_)
+  .quad __trampoline_seg_stop 
+GLOBAL(per_cpu_start_)
+  .quad __per_cpu_start
+GLOBAL(per_cpu_data_end_)
+  .quad __per_cpu_data_end
+GLOBAL(srodata_)
+  .quad _srodata
+GLOBAL(erodata_)
+  .quad _erodata
+GLOBAL(sinittext_)
+  .quad _sinittext
+GLOBAL(einittext_)
+  .quad _einittext
+GLOBAL(note_gnu_build_id_start_)
+  .quad __note_gnu_build_id_start
+GLOBAL(note_gnu_build_id_end_)
+  .quad __note_gnu_build_id_end
+#ifdef CONFIG_LOCK_PROFILE
+GLOBAL(lock_profile_start_)
+  .quad __lock_profile_start
+GLOBAL(lock_profile_end_)
+  .quad __lock_profile_end
+#endif
+GLOBAL(initcall_start_)
+  .quad __initcall_start
+GLOBAL(initcall_end_)
+  .quad __initcall_end
+GLOBAL(presmp_initcall_end_)
+  .quad __presmp_initcall_end
+GLOBAL(ctors_start_)
+  .quad __ctors_start
+GLOBAL(ctors_end_)
+  .quad __ctors_end
+GLOBAL(end_schedulers_array_)
+  .quad __end_schedulers_array
+GLOBAL(start_schedulers_array_)
+  .quad __start_schedulers_array
+GLOBAL(start_bug_frames_)
+  .quad __start_bug_frames
+GLOBAL(stop_bug_frames_0_)
+  .quad __stop_bug_frames_0
+GLOBAL(stop_bug_frames_1_)
+  .quad __stop_bug_frames_1
+GLOBAL(stop_bug_frames_2_)
+  .quad __stop_bug_frames_2
+GLOBAL(stop_bug_frames_3_)
+  .quad __stop_bug_frames_3
-- 
1.9.1


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

 


Rackspace

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