Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] 3486/1: Mark memory as clobbered by the ARM _syscallX() macros

Patch from Markus Gutschke

In order to prevent gcc from making incorrect optimizations, all asm()
statements that define system calls should report memory as
clobbered. Recent versions of the headers for i386 have been changed
accordingly, but the ARM headers are still defective.

This patch fixes the bug tracked at
http://bugzilla.kernel.org/show_bug.cgi?id=6205

Signed-off-by: Markus Gutschke <markus@google.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Markus Gutschke and committed by
Russell King
cd95842c e0a515bc

+15 -8
+1 -1
drivers/input/touchscreen/corgi_ts.c
··· 17 17 #include <linux/interrupt.h> 18 18 #include <linux/module.h> 19 19 #include <linux/slab.h> 20 - #include <asm/irq.h> 20 + //#include <asm/irq.h> 21 21 22 22 #include <asm/arch/sharpsl.h> 23 23 #include <asm/arch/hardware.h>
+14 -7
include/asm-arm/unistd.h
··· 410 410 __asm__ __volatile__ ( \ 411 411 __syscall(name) \ 412 412 : "=r" (__res_r0) \ 413 - : __SYS_REG_LIST() ); \ 413 + : __SYS_REG_LIST() \ 414 + : "memory" ); \ 414 415 __res = __res_r0; \ 415 416 __syscall_return(type,__res); \ 416 417 } ··· 425 424 __asm__ __volatile__ ( \ 426 425 __syscall(name) \ 427 426 : "=r" (__res_r0) \ 428 - : __SYS_REG_LIST( "0" (__r0) ) ); \ 427 + : __SYS_REG_LIST( "0" (__r0) ) \ 428 + : "memory" ); \ 429 429 __res = __res_r0; \ 430 430 __syscall_return(type,__res); \ 431 431 } ··· 441 439 __asm__ __volatile__ ( \ 442 440 __syscall(name) \ 443 441 : "=r" (__res_r0) \ 444 - : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) ); \ 442 + : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) \ 443 + : "memory" ); \ 445 444 __res = __res_r0; \ 446 445 __syscall_return(type,__res); \ 447 446 } ··· 459 456 __asm__ __volatile__ ( \ 460 457 __syscall(name) \ 461 458 : "=r" (__res_r0) \ 462 - : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) ); \ 459 + : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) \ 460 + : "memory" ); \ 463 461 __res = __res_r0; \ 464 462 __syscall_return(type,__res); \ 465 463 } ··· 478 474 __asm__ __volatile__ ( \ 479 475 __syscall(name) \ 480 476 : "=r" (__res_r0) \ 481 - : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) ); \ 477 + : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) \ 478 + : "memory" ); \ 482 479 __res = __res_r0; \ 483 480 __syscall_return(type,__res); \ 484 481 } ··· 499 494 __syscall(name) \ 500 495 : "=r" (__res_r0) \ 501 496 : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ 502 - "r" (__r3), "r" (__r4) ) ); \ 497 + "r" (__r3), "r" (__r4) ) \ 498 + : "memory" ); \ 503 499 __res = __res_r0; \ 504 500 __syscall_return(type,__res); \ 505 501 } ··· 520 514 __syscall(name) \ 521 515 : "=r" (__res_r0) \ 522 516 : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ 523 - "r" (__r3), "r" (__r4), "r" (__r5) ) ); \ 517 + "r" (__r3), "r" (__r4), "r" (__r5) ) \ 518 + : "memory" ); \ 524 519 __res = __res_r0; \ 525 520 __syscall_return(type,__res); \ 526 521 }