Hi,
The cacheflush system call does not return EINVAL in the latest Linux kernel.
see the link:
A related patch about the cacheflush function:
http://lkml.org/lkml/2009/4/9/203
But Ralf had refused this patch:
http://www.spinics.net/lists/linux-man/msg00906.html
cacheflush01 testcase checks if the return value is EINVAL when the cache
argument is not one of ICACHE, BCACHE or DCACHE. So it will fail in all boards.
In this modification, checking return value SUCCESS will be added, instead of
checking EINVAL
Signed-off-by: Feng Gao <[email protected]>
BR,
Feng Gao
From 39c14986c62155fcaee202785684eae43d2524f4 Mon Sep 17 00:00:00 2001
From: Feng Gao <[email protected]>
Date: Tue, 31 Aug 2010 17:39:21 +0800
Subject: [PATCH] Modify the cacheflush01 test case.
The cacheflush system call does not return EINVAL in the latest Linux kernel. see the link:
A related patch about the cacheflush function:
http://lkml.org/lkml/2009/4/9/203
But Ralf had refused this patch:
http://www.spinics.net/lists/linux-man/msg00906.html
cacheflush01 testcase checks if the return value is EINVAL when the cache argument is not one of ICACHE, BCACHE or DCACHE. So it will fail in all boards.
In this modification, checking return value SUCCESS will be added, instead of checking EINVAL
Signed-off-by: Feng Gao <[email protected]>
---
.../kernel/syscalls/cacheflush/cacheflush01.c | 28 ++++++++++++--------
1 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/testcases/kernel/syscalls/cacheflush/cacheflush01.c b/testcases/kernel/syscalls/cacheflush/cacheflush01.c
index cce0b70..d0a4b1f 100644
--- a/testcases/kernel/syscalls/cacheflush/cacheflush01.c
+++ b/testcases/kernel/syscalls/cacheflush/cacheflush01.c
@@ -152,20 +152,26 @@ int main(int ac, char **av)
/* Invokes cacheflush() with proper parameters */
TEST(syscall(__NR_cacheflush, addr, getpagesize(), ICACHE));
+ if (TEST_RETURN == 0) {
+ tst_resm(TPASS, "passed with no errno");
+ } else {
+ tst_resm(TFAIL, "failed with unexpected errno");
+ }
+
TEST(syscall(__NR_cacheflush, addr, getpagesize(), DCACHE));
+ if (TEST_RETURN == 0) {
+ tst_resm(TPASS, "passed with no errno");
+ } else {
+ tst_resm(TFAIL, "failed with unexpected errno");
+ }
+
TEST(syscall(__NR_cacheflush, addr, getpagesize(), BCACHE));
-
- /* Tests whether cacheflush() returns -EINVAL */
- TEST(syscall(__NR_cacheflush, addr, getpagesize(), 0));
- if (TEST_RETURN < 0) {
- if (TEST_ERRNO == EINVAL) {
- tst_resm(TPASS | TTERRNO, "passed with expected errno");
- } else {
- tst_resm(TFAIL | TTERRNO, "failed with unexpected errno");
- }
+ if (TEST_RETURN == 0) {
+ tst_resm(TPASS, "passed with no errno");
} else {
- tst_resm(TFAIL, "passed unexpectedly");
- }
+ tst_resm(TFAIL, "failed with unexpected errno");
+ }
+
cleanup();
tst_exit();
}
--
1.5.6.3
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list