diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2012-03-29 14:05:04 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2012-04-02 12:12:42 -0400 |
commit | efb734d8ed040b053f53fd53589ed5d9c9b5cd04 (patch) | |
tree | 6f001ff457da8e8a2020f3c3ec5f7cf7c9e561ff /arch/tile | |
parent | b287f69676a34a9fc341de4d79a9c74e1959dec6 (diff) |
arch/tile: make sure to build memcpy_user_64 without frame pointer
Add a comment explaining why this is important, and add a CFLAGS_REMOVE
clause to the Makefile to make sure it happens.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile')
-rw-r--r-- | arch/tile/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/tile/lib/memcpy_user_64.c | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/arch/tile/lib/Makefile b/arch/tile/lib/Makefile index 0c26086ecbef..985f59858234 100644 --- a/arch/tile/lib/Makefile +++ b/arch/tile/lib/Makefile | |||
@@ -7,6 +7,7 @@ lib-y = cacheflush.o checksum.o cpumask.o delay.o uaccess.o \ | |||
7 | strchr_$(BITS).o strlen_$(BITS).o | 7 | strchr_$(BITS).o strlen_$(BITS).o |
8 | 8 | ||
9 | ifeq ($(CONFIG_TILEGX),y) | 9 | ifeq ($(CONFIG_TILEGX),y) |
10 | CFLAGS_REMOVE_memcpy_user_64.o = -fno-omit-frame-pointer | ||
10 | lib-y += memcpy_user_64.o | 11 | lib-y += memcpy_user_64.o |
11 | else | 12 | else |
12 | lib-y += atomic_32.o atomic_asm_32.o memcpy_tile64.o | 13 | lib-y += atomic_32.o atomic_asm_32.o memcpy_tile64.o |
diff --git a/arch/tile/lib/memcpy_user_64.c b/arch/tile/lib/memcpy_user_64.c index 4763b3aff1cc..37440caa7370 100644 --- a/arch/tile/lib/memcpy_user_64.c +++ b/arch/tile/lib/memcpy_user_64.c | |||
@@ -14,7 +14,13 @@ | |||
14 | * Do memcpy(), but trap and return "n" when a load or store faults. | 14 | * Do memcpy(), but trap and return "n" when a load or store faults. |
15 | * | 15 | * |
16 | * Note: this idiom only works when memcpy() compiles to a leaf function. | 16 | * Note: this idiom only works when memcpy() compiles to a leaf function. |
17 | * If "sp" is updated during memcpy, the "jrp lr" will be incorrect. | 17 | * Here leaf function not only means it does not have calls, but also |
18 | * requires no stack operations (sp, stack frame pointer) and no | ||
19 | * use of callee-saved registers, else "jrp lr" will be incorrect since | ||
20 | * unwinding stack frame is bypassed. Since memcpy() is not complex so | ||
21 | * these conditions are satisfied here, but we need to be careful when | ||
22 | * modifying this file. This is not a clean solution but is the best | ||
23 | * one so far. | ||
18 | * | 24 | * |
19 | * Also note that we are capturing "n" from the containing scope here. | 25 | * Also note that we are capturing "n" from the containing scope here. |
20 | */ | 26 | */ |