aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-09-25 03:28:58 -0400
committerIngo Molnar <mingo@kernel.org>2015-09-25 03:28:58 -0400
commit9c9ab385bc6c3f0787f742d5e9baf04063d9697a (patch)
treecc6ac425f7580a40d011ad2e8fc7974678843e0b /tools
parent93f13a9f96771a064c716364aebc6e283b186eb8 (diff)
parentbcee19f424a0d8c26ecf2607b73c690802658b29 (diff)
Merge branch 'linus' into x86/asm, to refresh the tree before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/Makefile2
-rw-r--r--tools/testing/selftests/exec/Makefile4
-rw-r--r--tools/testing/selftests/ftrace/Makefile2
-rw-r--r--tools/testing/selftests/lib.mk11
-rw-r--r--tools/testing/selftests/mqueue/Makefile10
-rw-r--r--tools/testing/selftests/seccomp/seccomp_bpf.c37
-rw-r--r--tools/testing/selftests/seccomp/test_harness.h7
-rw-r--r--tools/testing/selftests/vm/userfaultfd.c2
-rwxr-xr-xtools/testing/selftests/zram/zram.sh10
-rwxr-xr-xtools/testing/selftests/zram/zram_lib.sh3
-rw-r--r--tools/virtio/Makefile2
-rw-r--r--tools/virtio/asm/barrier.h2
-rw-r--r--tools/virtio/linux/export.h3
-rw-r--r--tools/virtio/linux/kernel.h8
14 files changed, 68 insertions, 35 deletions
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 89b05e2222c9..cfe121353eec 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -16,12 +16,12 @@ TARGETS += powerpc
16TARGETS += ptrace 16TARGETS += ptrace
17TARGETS += seccomp 17TARGETS += seccomp
18TARGETS += size 18TARGETS += size
19TARGETS += static_keys
19TARGETS += sysctl 20TARGETS += sysctl
20ifneq (1, $(quicktest)) 21ifneq (1, $(quicktest))
21TARGETS += timers 22TARGETS += timers
22endif 23endif
23TARGETS += user 24TARGETS += user
24TARGETS += jumplabel
25TARGETS += vm 25TARGETS += vm
26TARGETS += x86 26TARGETS += x86
27TARGETS += zram 27TARGETS += zram
diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile
index 6b76bfdc847e..4e400eb83657 100644
--- a/tools/testing/selftests/exec/Makefile
+++ b/tools/testing/selftests/exec/Makefile
@@ -1,6 +1,6 @@
1CFLAGS = -Wall 1CFLAGS = -Wall
2BINARIES = execveat 2BINARIES = execveat
3DEPS = execveat.symlink execveat.denatured script 3DEPS = execveat.symlink execveat.denatured script subdir
4all: $(BINARIES) $(DEPS) 4all: $(BINARIES) $(DEPS)
5 5
6subdir: 6subdir:
@@ -22,7 +22,5 @@ TEST_FILES := $(DEPS)
22 22
23include ../lib.mk 23include ../lib.mk
24 24
25override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
26
27clean: 25clean:
28 rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx* 26 rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx*
diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile
index 0acbeca47225..4e6ed13e7f66 100644
--- a/tools/testing/selftests/ftrace/Makefile
+++ b/tools/testing/selftests/ftrace/Makefile
@@ -1,7 +1,7 @@
1all: 1all:
2 2
3TEST_PROGS := ftracetest 3TEST_PROGS := ftracetest
4TEST_DIRS := test.d/ 4TEST_DIRS := test.d
5 5
6include ../lib.mk 6include ../lib.mk
7 7
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 97f1c6742066..50a93f5f13d6 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -12,13 +12,10 @@ run_tests: all
12 $(RUN_TESTS) 12 $(RUN_TESTS)
13 13
14define INSTALL_RULE 14define INSTALL_RULE
15 @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \ 15 @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \
16 mkdir -p $(INSTALL_PATH); \ 16 mkdir -p ${INSTALL_PATH}; \
17 for TEST_DIR in $(TEST_DIRS); do \ 17 echo "rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/"; \
18 cp -r $$TEST_DIR $(INSTALL_PATH); \ 18 rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/; \
19 done; \
20 echo "install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)"; \
21 install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES); \
22 fi 19 fi
23endef 20endef
24 21
diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
index 0e3b41eb85cd..eebac29acbd9 100644
--- a/tools/testing/selftests/mqueue/Makefile
+++ b/tools/testing/selftests/mqueue/Makefile
@@ -1,8 +1,8 @@
1CFLAGS = -O2 1CFLAGS += -O2
2LDLIBS = -lrt -lpthread -lpopt
3TEST_PROGS := mq_open_tests mq_perf_tests
2 4
3all: 5all: $(TEST_PROGS)
4 $(CC) $(CFLAGS) mq_open_tests.c -o mq_open_tests -lrt
5 $(CC) $(CFLAGS) -o mq_perf_tests mq_perf_tests.c -lrt -lpthread -lpopt
6 6
7include ../lib.mk 7include ../lib.mk
8 8
@@ -11,8 +11,6 @@ override define RUN_TESTS
11 @./mq_perf_tests || echo "selftests: mq_perf_tests [FAIL]" 11 @./mq_perf_tests || echo "selftests: mq_perf_tests [FAIL]"
12endef 12endef
13 13
14TEST_PROGS := mq_open_tests mq_perf_tests
15
16override define EMIT_TESTS 14override define EMIT_TESTS
17 echo "./mq_open_tests /test1 || echo \"selftests: mq_open_tests [FAIL]\"" 15 echo "./mq_open_tests /test1 || echo \"selftests: mq_open_tests [FAIL]\""
18 echo "./mq_perf_tests || echo \"selftests: mq_perf_tests [FAIL]\"" 16 echo "./mq_perf_tests || echo \"selftests: mq_perf_tests [FAIL]\""
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index a004b4cce99e..770f47adf295 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -1210,6 +1210,10 @@ TEST_F(TRACE_poke, getpid_runs_normally)
1210# define ARCH_REGS struct pt_regs 1210# define ARCH_REGS struct pt_regs
1211# define SYSCALL_NUM gpr[0] 1211# define SYSCALL_NUM gpr[0]
1212# define SYSCALL_RET gpr[3] 1212# define SYSCALL_RET gpr[3]
1213#elif defined(__s390__)
1214# define ARCH_REGS s390_regs
1215# define SYSCALL_NUM gprs[2]
1216# define SYSCALL_RET gprs[2]
1213#else 1217#else
1214# error "Do not know how to find your architecture's registers and syscalls" 1218# error "Do not know how to find your architecture's registers and syscalls"
1215#endif 1219#endif
@@ -1243,7 +1247,8 @@ void change_syscall(struct __test_metadata *_metadata,
1243 ret = ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov); 1247 ret = ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov);
1244 EXPECT_EQ(0, ret); 1248 EXPECT_EQ(0, ret);
1245 1249
1246#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || defined(__powerpc__) 1250#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || \
1251 defined(__powerpc__) || defined(__s390__)
1247 { 1252 {
1248 regs.SYSCALL_NUM = syscall; 1253 regs.SYSCALL_NUM = syscall;
1249 } 1254 }
@@ -1281,17 +1286,21 @@ void tracer_syscall(struct __test_metadata *_metadata, pid_t tracee,
1281 ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg); 1286 ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg);
1282 EXPECT_EQ(0, ret); 1287 EXPECT_EQ(0, ret);
1283 1288
1289 /* Validate and take action on expected syscalls. */
1284 switch (msg) { 1290 switch (msg) {
1285 case 0x1002: 1291 case 0x1002:
1286 /* change getpid to getppid. */ 1292 /* change getpid to getppid. */
1293 EXPECT_EQ(__NR_getpid, get_syscall(_metadata, tracee));
1287 change_syscall(_metadata, tracee, __NR_getppid); 1294 change_syscall(_metadata, tracee, __NR_getppid);
1288 break; 1295 break;
1289 case 0x1003: 1296 case 0x1003:
1290 /* skip gettid. */ 1297 /* skip gettid. */
1298 EXPECT_EQ(__NR_gettid, get_syscall(_metadata, tracee));
1291 change_syscall(_metadata, tracee, -1); 1299 change_syscall(_metadata, tracee, -1);
1292 break; 1300 break;
1293 case 0x1004: 1301 case 0x1004:
1294 /* do nothing (allow getppid) */ 1302 /* do nothing (allow getppid) */
1303 EXPECT_EQ(__NR_getppid, get_syscall(_metadata, tracee));
1295 break; 1304 break;
1296 default: 1305 default:
1297 EXPECT_EQ(0, msg) { 1306 EXPECT_EQ(0, msg) {
@@ -1409,6 +1418,8 @@ TEST_F(TRACE_syscall, syscall_dropped)
1409# define __NR_seccomp 277 1418# define __NR_seccomp 277
1410# elif defined(__powerpc__) 1419# elif defined(__powerpc__)
1411# define __NR_seccomp 358 1420# define __NR_seccomp 358
1421# elif defined(__s390__)
1422# define __NR_seccomp 348
1412# else 1423# else
1413# warning "seccomp syscall number unknown for this architecture" 1424# warning "seccomp syscall number unknown for this architecture"
1414# define __NR_seccomp 0xffff 1425# define __NR_seccomp 0xffff
@@ -1453,6 +1464,9 @@ TEST(seccomp_syscall)
1453 1464
1454 /* Reject insane operation. */ 1465 /* Reject insane operation. */
1455 ret = seccomp(-1, 0, &prog); 1466 ret = seccomp(-1, 0, &prog);
1467 ASSERT_NE(ENOSYS, errno) {
1468 TH_LOG("Kernel does not support seccomp syscall!");
1469 }
1456 EXPECT_EQ(EINVAL, errno) { 1470 EXPECT_EQ(EINVAL, errno) {
1457 TH_LOG("Did not reject crazy op value!"); 1471 TH_LOG("Did not reject crazy op value!");
1458 } 1472 }
@@ -1501,6 +1515,9 @@ TEST(seccomp_syscall_mode_lock)
1501 } 1515 }
1502 1516
1503 ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog); 1517 ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog);
1518 ASSERT_NE(ENOSYS, errno) {
1519 TH_LOG("Kernel does not support seccomp syscall!");
1520 }
1504 EXPECT_EQ(0, ret) { 1521 EXPECT_EQ(0, ret) {
1505 TH_LOG("Could not install filter!"); 1522 TH_LOG("Could not install filter!");
1506 } 1523 }
@@ -1535,6 +1552,9 @@ TEST(TSYNC_first)
1535 1552
1536 ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, 1553 ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC,
1537 &prog); 1554 &prog);
1555 ASSERT_NE(ENOSYS, errno) {
1556 TH_LOG("Kernel does not support seccomp syscall!");
1557 }
1538 EXPECT_EQ(0, ret) { 1558 EXPECT_EQ(0, ret) {
1539 TH_LOG("Could not install initial filter with TSYNC!"); 1559 TH_LOG("Could not install initial filter with TSYNC!");
1540 } 1560 }
@@ -1694,6 +1714,9 @@ TEST_F(TSYNC, siblings_fail_prctl)
1694 1714
1695 /* Check prctl failure detection by requesting sib 0 diverge. */ 1715 /* Check prctl failure detection by requesting sib 0 diverge. */
1696 ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog); 1716 ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog);
1717 ASSERT_NE(ENOSYS, errno) {
1718 TH_LOG("Kernel does not support seccomp syscall!");
1719 }
1697 ASSERT_EQ(0, ret) { 1720 ASSERT_EQ(0, ret) {
1698 TH_LOG("setting filter failed"); 1721 TH_LOG("setting filter failed");
1699 } 1722 }
@@ -1731,6 +1754,9 @@ TEST_F(TSYNC, two_siblings_with_ancestor)
1731 } 1754 }
1732 1755
1733 ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog); 1756 ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog);
1757 ASSERT_NE(ENOSYS, errno) {
1758 TH_LOG("Kernel does not support seccomp syscall!");
1759 }
1734 ASSERT_EQ(0, ret) { 1760 ASSERT_EQ(0, ret) {
1735 TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!"); 1761 TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!");
1736 } 1762 }
@@ -1805,6 +1831,9 @@ TEST_F(TSYNC, two_siblings_with_no_filter)
1805 1831
1806 ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, 1832 ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC,
1807 &self->apply_prog); 1833 &self->apply_prog);
1834 ASSERT_NE(ENOSYS, errno) {
1835 TH_LOG("Kernel does not support seccomp syscall!");
1836 }
1808 ASSERT_EQ(0, ret) { 1837 ASSERT_EQ(0, ret) {
1809 TH_LOG("Could install filter on all threads!"); 1838 TH_LOG("Could install filter on all threads!");
1810 } 1839 }
@@ -1833,6 +1862,9 @@ TEST_F(TSYNC, two_siblings_with_one_divergence)
1833 } 1862 }
1834 1863
1835 ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog); 1864 ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog);
1865 ASSERT_NE(ENOSYS, errno) {
1866 TH_LOG("Kernel does not support seccomp syscall!");
1867 }
1836 ASSERT_EQ(0, ret) { 1868 ASSERT_EQ(0, ret) {
1837 TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!"); 1869 TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!");
1838 } 1870 }
@@ -1890,6 +1922,9 @@ TEST_F(TSYNC, two_siblings_not_under_filter)
1890 } 1922 }
1891 1923
1892 ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog); 1924 ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog);
1925 ASSERT_NE(ENOSYS, errno) {
1926 TH_LOG("Kernel does not support seccomp syscall!");
1927 }
1893 ASSERT_EQ(0, ret) { 1928 ASSERT_EQ(0, ret) {
1894 TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!"); 1929 TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!");
1895 } 1930 }
diff --git a/tools/testing/selftests/seccomp/test_harness.h b/tools/testing/selftests/seccomp/test_harness.h
index 977a6afc4489..fb2841601f2f 100644
--- a/tools/testing/selftests/seccomp/test_harness.h
+++ b/tools/testing/selftests/seccomp/test_harness.h
@@ -370,11 +370,8 @@
370 __typeof__(_expected) __exp = (_expected); \ 370 __typeof__(_expected) __exp = (_expected); \
371 __typeof__(_seen) __seen = (_seen); \ 371 __typeof__(_seen) __seen = (_seen); \
372 if (!(__exp _t __seen)) { \ 372 if (!(__exp _t __seen)) { \
373 unsigned long long __exp_print = 0; \ 373 unsigned long long __exp_print = (unsigned long long)__exp; \
374 unsigned long long __seen_print = 0; \ 374 unsigned long long __seen_print = (unsigned long long)__seen; \
375 /* Avoid casting complaints the scariest way we can. */ \
376 memcpy(&__exp_print, &__exp, sizeof(__exp)); \
377 memcpy(&__seen_print, &__seen, sizeof(__seen)); \
378 __TH_LOG("Expected %s (%llu) %s %s (%llu)", \ 375 __TH_LOG("Expected %s (%llu) %s %s (%llu)", \
379 #_expected, __exp_print, #_t, \ 376 #_expected, __exp_print, #_t, \
380 #_seen, __seen_print); \ 377 #_seen, __seen_print); \
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index 2c7cca6f26a4..7c1d958857d2 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -72,6 +72,8 @@
72#define __NR_userfaultfd 374 72#define __NR_userfaultfd 374
73#elif defined(__powewrpc__) 73#elif defined(__powewrpc__)
74#define __NR_userfaultfd 364 74#define __NR_userfaultfd 364
75#elif defined(__s390__)
76#define __NR_userfaultfd 355
75#else 77#else
76#error "missing __NR_userfaultfd definition" 78#error "missing __NR_userfaultfd definition"
77#endif 79#endif
diff --git a/tools/testing/selftests/zram/zram.sh b/tools/testing/selftests/zram/zram.sh
index 20de9a761269..683a292e3290 100755
--- a/tools/testing/selftests/zram/zram.sh
+++ b/tools/testing/selftests/zram/zram.sh
@@ -1,15 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2TCID="zram.sh" 2TCID="zram.sh"
3 3
4check_prereqs() 4. ./zram_lib.sh
5{
6 local msg="skip all tests:"
7
8 if [ $UID != 0 ]; then
9 echo $msg must be run as root >&2
10 exit 0
11 fi
12}
13 5
14run_zram () { 6run_zram () {
15echo "--------------------" 7echo "--------------------"
diff --git a/tools/testing/selftests/zram/zram_lib.sh b/tools/testing/selftests/zram/zram_lib.sh
index 424e68ed1487..f6a9c73e7a44 100755
--- a/tools/testing/selftests/zram/zram_lib.sh
+++ b/tools/testing/selftests/zram/zram_lib.sh
@@ -23,8 +23,9 @@ trap INT
23check_prereqs() 23check_prereqs()
24{ 24{
25 local msg="skip all tests:" 25 local msg="skip all tests:"
26 local uid=$(id -u)
26 27
27 if [ $UID != 0 ]; then 28 if [ $uid -ne 0 ]; then
28 echo $msg must be run as root >&2 29 echo $msg must be run as root >&2
29 exit 0 30 exit 0
30 fi 31 fi
diff --git a/tools/virtio/Makefile b/tools/virtio/Makefile
index 505ad51b3b51..39c89a5ea990 100644
--- a/tools/virtio/Makefile
+++ b/tools/virtio/Makefile
@@ -6,7 +6,7 @@ vringh_test: vringh_test.o vringh.o virtio_ring.o
6CFLAGS += -g -O2 -Werror -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE 6CFLAGS += -g -O2 -Werror -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE
7vpath %.c ../../drivers/virtio ../../drivers/vhost 7vpath %.c ../../drivers/virtio ../../drivers/vhost
8mod: 8mod:
9 ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test 9 ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V}
10.PHONY: all test mod clean 10.PHONY: all test mod clean
11clean: 11clean:
12 ${RM} *.o vringh_test virtio_test vhost_test/*.o vhost_test/.*.cmd \ 12 ${RM} *.o vringh_test virtio_test vhost_test/*.o vhost_test/.*.cmd \
diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h
index aff61e13306c..26b7926bda88 100644
--- a/tools/virtio/asm/barrier.h
+++ b/tools/virtio/asm/barrier.h
@@ -3,6 +3,8 @@
3#define mb() __sync_synchronize() 3#define mb() __sync_synchronize()
4 4
5#define smp_mb() mb() 5#define smp_mb() mb()
6# define dma_rmb() barrier()
7# define dma_wmb() barrier()
6# define smp_rmb() barrier() 8# define smp_rmb() barrier()
7# define smp_wmb() barrier() 9# define smp_wmb() barrier()
8/* Weak barriers should be used. If not - it's a bug */ 10/* Weak barriers should be used. If not - it's a bug */
diff --git a/tools/virtio/linux/export.h b/tools/virtio/linux/export.h
new file mode 100644
index 000000000000..416875e29254
--- /dev/null
+++ b/tools/virtio/linux/export.h
@@ -0,0 +1,3 @@
1#define EXPORT_SYMBOL_GPL(sym) extern typeof(sym) sym
2#define EXPORT_SYMBOL(sym) extern typeof(sym) sym
3
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h
index 1e8ce6979c1e..0a3da64638ce 100644
--- a/tools/virtio/linux/kernel.h
+++ b/tools/virtio/linux/kernel.h
@@ -22,6 +22,7 @@
22 22
23typedef unsigned long long dma_addr_t; 23typedef unsigned long long dma_addr_t;
24typedef size_t __kernel_size_t; 24typedef size_t __kernel_size_t;
25typedef unsigned int __wsum;
25 26
26struct page { 27struct page {
27 unsigned long long dummy; 28 unsigned long long dummy;
@@ -47,6 +48,13 @@ static inline void *kmalloc(size_t s, gfp_t gfp)
47 return __kmalloc_fake; 48 return __kmalloc_fake;
48 return malloc(s); 49 return malloc(s);
49} 50}
51static inline void *kzalloc(size_t s, gfp_t gfp)
52{
53 void *p = kmalloc(s, gfp);
54
55 memset(p, 0, s);
56 return p;
57}
50 58
51static inline void kfree(void *p) 59static inline void kfree(void *p)
52{ 60{