summaryrefslogtreecommitdiffstats
path: root/src/arch
diff options
context:
space:
mode:
authorMichael Brown2016-02-21 12:13:04 +0100
committerMichael Brown2016-02-21 12:13:04 +0100
commitb6ebafe1bba5fa841c71a03f1a264e6a17ed8584 (patch)
tree0a5ec534011e7249debdfc929b33f2ffd81b072a /src/arch
parent[librm] Do not preserve flags unnecessarily (diff)
downloadipxe-b6ebafe1bba5fa841c71a03f1a264e6a17ed8584.tar.gz
ipxe-b6ebafe1bba5fa841c71a03f1a264e6a17ed8584.tar.xz
ipxe-b6ebafe1bba5fa841c71a03f1a264e6a17ed8584.zip
[librm] Mark virt_offset, text16, data16, rm_cs, and rm_ds as constant
The physical locations of .textdata, .text16 and .data16 are constant from the point of view of C code. Mark the relevant variables as constant to allow gcc to optimise out redundant reads. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/include/librm.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/arch/x86/include/librm.h b/src/arch/x86/include/librm.h
index bc925a2d..efc8b114 100644
--- a/src/arch/x86/include/librm.h
+++ b/src/arch/x86/include/librm.h
@@ -79,7 +79,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
"call prot_call\n\t"
/* Variables in librm.S */
-extern unsigned long virt_offset;
+extern const unsigned long virt_offset;
/**
* Convert physical address to user pointer
@@ -170,8 +170,8 @@ UACCESS_INLINE ( librm, memchr_user ) ( userptr_t buffer, off_t offset,
*
*/
-extern char *data16;
-extern char *text16;
+extern char * const data16;
+extern char * const text16;
#define __data16( variable ) \
__attribute__ (( section ( ".data16" ) )) \
@@ -216,9 +216,9 @@ extern char *text16;
/* Variables in librm.S, present in the normal data segment */
extern uint16_t rm_sp;
extern uint16_t rm_ss;
-extern uint16_t __text16 ( rm_cs );
+extern const uint16_t __text16 ( rm_cs );
#define rm_cs __use_text16 ( rm_cs )
-extern uint16_t __text16 ( rm_ds );
+extern const uint16_t __text16 ( rm_ds );
#define rm_ds __use_text16 ( rm_ds )
extern uint16_t copy_user_to_rm_stack ( userptr_t data, size_t size );