From bb2a39cc74b21c806ac336817f56f48f928a7974 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Mon, 17 Feb 2020 01:07:15 +0100 Subject: [PATCH] kern: fix compilation warning; raise qa timeouts --- qa/lib/c/qlockt0.c | 2 +- qa/lib/c/qlockt1.c | 2 +- qa/lib/c/qlockt2.c | 2 +- qa/lib/c/rlockt0.c | 2 +- qa/lib/c/rlockt1.c | 4 ++-- qa/lib/c/rlockt2.c | 2 +- qa/lib/c/rsleept0.c | 2 +- qa/lib/c/rsleept1.c | 2 +- qa/lib/c/rsleept2.c | 2 +- qa/lib/c/wlockt0.c | 2 +- qa/lib/c/wlockt2.c | 2 +- qa/lib/newlib/104-files-nonblocking.c | 8 ++++---- qa/lib/newlib/121-fcntl.c | 10 +++++----- qa/lib/newlib/200-signals.c | 8 ++++---- qa/lib/newlib/201-signals.c | 8 ++++---- qa/lib/newlib/202-signals.c | 8 ++++---- qa/lib/newlib/203-signals.c | 8 ++++---- qa/lib/newlib/204-signals.c | 8 ++++---- qa/lib/newlib/build.json | 8 ++++---- qa/lib/newlib/testsuite/build.json | 4 ++-- sys/src/kern/amd64/usbohci.c | 2 +- 21 files changed, 48 insertions(+), 48 deletions(-) diff --git a/qa/lib/c/qlockt0.c b/qa/lib/c/qlockt0.c index ab8498c..c2374f5 100644 --- a/qa/lib/c/qlockt0.c +++ b/qa/lib/c/qlockt0.c @@ -210,7 +210,7 @@ main(int argc, char* argv[]) } average = average / NPROC / (1000 * 1000); - if(average > 900 && average < 1300) /* 30% error on timeout is acceptable */ + if(average > 900 && average < 3000) { print("PASS\n"); exits("PASS"); diff --git a/qa/lib/c/qlockt1.c b/qa/lib/c/qlockt1.c index f61deed..8923ef0 100644 --- a/qa/lib/c/qlockt1.c +++ b/qa/lib/c/qlockt1.c @@ -111,7 +111,7 @@ waiter(int index) if(verbose) print("waiter %d: got the qlock in %lld ms\n", getpid(), (end - start) / (1000*1000)); qunlock(&afterAWhile); - if((end - start) / (1000*1000) > 1500) + if((end - start) / (1000*1000) > 3000) postnote(PNGROUP, getpid(), smprint("fail: waiter %d got the qlock after %lld ms", getpid(), (end - start) / (1000*1000))); } else { if(verbose) diff --git a/qa/lib/c/qlockt2.c b/qa/lib/c/qlockt2.c index d144e39..38d100a 100644 --- a/qa/lib/c/qlockt2.c +++ b/qa/lib/c/qlockt2.c @@ -208,7 +208,7 @@ main(int argc, char* argv[]) } average = average / NPROC / (1000 * 1000); - if(average < 1000) /* we asked for 1ms... we are dumb, after all */ + if(average < 3000) /* we asked for 1ms... we are dumb, after all */ { print("PASS\n"); exits("PASS"); diff --git a/qa/lib/c/rlockt0.c b/qa/lib/c/rlockt0.c index 7b4cd46..68214b0 100644 --- a/qa/lib/c/rlockt0.c +++ b/qa/lib/c/rlockt0.c @@ -210,7 +210,7 @@ main(int argc, char* argv[]) } average = average / NPROC / (1000 * 1000); - if(average > 900 && average < 1300) /* 30% error on timeout is acceptable */ + if(average > 900 && average < 3000) { print("PASS\n"); exits("PASS"); diff --git a/qa/lib/c/rlockt1.c b/qa/lib/c/rlockt1.c index e7697d2..98e7310 100644 --- a/qa/lib/c/rlockt1.c +++ b/qa/lib/c/rlockt1.c @@ -112,7 +112,7 @@ waiter(int index) if(verbose) print("reader %d: got the rlock in %lld ms\n", getpid(), (end - start) / (1000*1000)); runlock(&afterAWhile); - if((end - start) / (1000*1000) > 2000) + if((end - start) / (1000*1000) > 3000) postnote(PNGROUP, getpid(), smprint("fail: reader %d got the rlock after %lld ms", getpid(), (end - start) / (1000*1000))); } else { if(verbose) @@ -127,7 +127,7 @@ waiter(int index) rwakeup(&rCompleted); qunlock(&rl); - return (end - start) / (1000*1000) < 2000 ? nil : "FAIL"; + return (end - start) / (1000*1000) < 3000 ? nil : "FAIL"; } void diff --git a/qa/lib/c/rlockt2.c b/qa/lib/c/rlockt2.c index 13492ac..99310eb 100644 --- a/qa/lib/c/rlockt2.c +++ b/qa/lib/c/rlockt2.c @@ -214,7 +214,7 @@ main(int argc, char* argv[]) } average = average / NPROC / (1000 * 1000); - if(average < 800) /* we asked for 1ms... we are dumb, after all */ + if(average < 2000) /* we asked for 1ms... we are dumb, after all */ { print("PASS\n"); exits("PASS"); diff --git a/qa/lib/c/rsleept0.c b/qa/lib/c/rsleept0.c index cabe6c4..d7c1f70 100644 --- a/qa/lib/c/rsleept0.c +++ b/qa/lib/c/rsleept0.c @@ -209,7 +209,7 @@ main(int argc, char* argv[]) } average = average / NPROC / (1000 * 1000); - if(average > 900 && average < 1300) /* 30% error on timeout is acceptable */ + if(average > 900 && average < 3000) { print("PASS\n"); exits("PASS"); diff --git a/qa/lib/c/rsleept1.c b/qa/lib/c/rsleept1.c index 44d842e..11452b1 100644 --- a/qa/lib/c/rsleept1.c +++ b/qa/lib/c/rsleept1.c @@ -197,7 +197,7 @@ main(int argc, char* argv[]) qunlock(&rl); /* wait for ~1 sec */ - do { sleep(100); } while(nsec() < end); + do { sleep(1000); } while(nsec() < end); qlock(&l); awakened = rwakeupall(&afterAWhile); diff --git a/qa/lib/c/rsleept2.c b/qa/lib/c/rsleept2.c index 5851ed0..84906ef 100644 --- a/qa/lib/c/rsleept2.c +++ b/qa/lib/c/rsleept2.c @@ -215,7 +215,7 @@ main(int argc, char* argv[]) } average = average / NPROC / (1000 * 1000); - if(average < 1000) /* we asked for 1ms... we are dumb, after all */ + if(average < 2000) /* we asked for 1ms... we are dumb, after all */ { print("PASS\n"); exits("PASS"); diff --git a/qa/lib/c/wlockt0.c b/qa/lib/c/wlockt0.c index 587aac8..506f259 100644 --- a/qa/lib/c/wlockt0.c +++ b/qa/lib/c/wlockt0.c @@ -210,7 +210,7 @@ main(int argc, char* argv[]) } average = average / NPROC / (1000 * 1000); - if(average > 900 && average < 1300) /* 30% error on timeout is acceptable */ + if(average > 900 && average < 3000) { print("PASS\n"); exits("PASS"); diff --git a/qa/lib/c/wlockt2.c b/qa/lib/c/wlockt2.c index 519a495..feec10f 100644 --- a/qa/lib/c/wlockt2.c +++ b/qa/lib/c/wlockt2.c @@ -210,7 +210,7 @@ main(int argc, char* argv[]) } average = average / NPROC / (1000 * 1000); - if(average < 1000) /* we asked for 1ms... we are dumb, after all */ + if(average < 2000) /* we asked for 1ms... we are dumb, after all */ { print("PASS\n"); exits("PASS"); diff --git a/qa/lib/newlib/104-files-nonblocking.c b/qa/lib/newlib/104-files-nonblocking.c index 48fb787..b391f70 100644 --- a/qa/lib/newlib/104-files-nonblocking.c +++ b/qa/lib/newlib/104-files-nonblocking.c @@ -17,7 +17,7 @@ void parent_read(int p[]) char buf[MSGSIZE]; // write link - sys_close(p[1]); + close(p[1]); while (1) { @@ -45,7 +45,7 @@ void parent_read(int p[]) printf("End of conversation\n"); // read link - sys_close(p[0]); + close(p[0]); exit(0); default: @@ -62,7 +62,7 @@ void child_write(int p[]) int i; // read link - sys_close(p[0]); + close(p[0]); // write 3 times "hello" in 3 second interval for (i = 0; i < 3; i++) { @@ -74,7 +74,7 @@ void child_write(int p[]) write(p[1], msg2, MSGSIZE); // here after write all bytes then write end - // doesn't sys_close so read end block but + // doesn't close so read end block but // because of fcntl block doesn't happen.. exit(0); } diff --git a/qa/lib/newlib/121-fcntl.c b/qa/lib/newlib/121-fcntl.c index 81fdc4b..ce423aa 100644 --- a/qa/lib/newlib/121-fcntl.c +++ b/qa/lib/newlib/121-fcntl.c @@ -32,18 +32,18 @@ main(int argc, char *argv[]) pipe(sync); outfd = dup(1); - nullfd = sys_open("/dev/null", O_WRONLY); + nullfd = open("/dev/null", O_WRONLY); tmp = fcntl(sync[0], F_DUPFD_CLOEXEC, 1); - sys_close(sync[0]); + close(sync[0]); sync[0] = tmp; tmp = fcntl(sync[1], F_DUPFD_CLOEXEC, 1); - sys_close(sync[1]); + close(sync[1]); sync[1] = tmp; tmp = fcntl(outfd, F_DUPFD_CLOEXEC, 1); - sys_close(outfd); + close(outfd); outfd = tmp; tmp = fcntl(nullfd, F_DUPFD_CLOEXEC, 1); - sys_close(nullfd); + close(nullfd); nullfd = tmp; eargv[0] = argv[0]; diff --git a/qa/lib/newlib/200-signals.c b/qa/lib/newlib/200-signals.c index 75a9547..a5a1746 100644 --- a/qa/lib/newlib/200-signals.c +++ b/qa/lib/newlib/200-signals.c @@ -59,8 +59,8 @@ main() { printf("\nChild going to loop...\n\n"); write(p[1], "", 1); - sys_close(p[1]); - sys_close(p[0]); + close(p[1]); + close(p[0]); for(;;); /* loop for ever */ } else /* parent */ @@ -70,8 +70,8 @@ main() { printf("sync read"); exit(EXIT_FAILURE); } - sys_close(p[1]); - sys_close(p[0]); + close(p[1]); + close(p[0]); printf("\nPARENT: sending SIGHUP\n\n"); kill(pid,SIGHUP); sleep(3); /* pause for 3 secs */ diff --git a/qa/lib/newlib/201-signals.c b/qa/lib/newlib/201-signals.c index 666d264..99ee57e 100644 --- a/qa/lib/newlib/201-signals.c +++ b/qa/lib/newlib/201-signals.c @@ -27,8 +27,8 @@ main() { if (pid == 0) { printf("\nI am the new child!\n\n"); write(p[1], "", 1); - sys_close(p[1]); - sys_close(p[0]); + close(p[1]); + close(p[0]); for(;;){ /* loop for ever */ printf("."); @@ -41,8 +41,8 @@ main() { printf("sync read"); exit(EXIT_FAILURE); } - sys_close(p[1]); - sys_close(p[0]); + close(p[1]); + close(p[0]); printf("\nPARENT: sending SIGINT\n\n"); kill(pid,SIGINT); do { diff --git a/qa/lib/newlib/202-signals.c b/qa/lib/newlib/202-signals.c index 107b4ea..862b239 100644 --- a/qa/lib/newlib/202-signals.c +++ b/qa/lib/newlib/202-signals.c @@ -29,8 +29,8 @@ main() { signal(SIGCONT,sigcont); /* set function calls */ printf("Child going to loop...\n"); write(p[1], "", 1); - sys_close(p[1]); - sys_close(p[0]); + close(p[1]); + close(p[0]); for(;;){ /* loop for ever */ printf("."); @@ -40,8 +40,8 @@ main() { else /* parent */ { read(p[0], &dummy, 1); - sys_close(p[1]); - sys_close(p[0]); + close(p[1]); + close(p[0]); printf("PARENT: sending SIGCONT\n\n"); kill(pid,SIGCONT); child = wait(&cstatus); diff --git a/qa/lib/newlib/203-signals.c b/qa/lib/newlib/203-signals.c index 3d162fb..6b3c503 100644 --- a/qa/lib/newlib/203-signals.c +++ b/qa/lib/newlib/203-signals.c @@ -24,8 +24,8 @@ void childloop(void) signal(SIGSTOP,sigstop); /* set function calls */ printf("Child %d going to loop...\n", getpid()); write(p[1], "", 1); - sys_close(p[1]); - sys_close(p[0]); + close(p[1]); + close(p[0]); for(;;){ /* loop for ever */ printf("."); @@ -56,8 +56,8 @@ main() { else /* parent */ { read(p[0], &dummy, 1); - sys_close(p[1]); - sys_close(p[0]); + close(p[1]); + close(p[0]); sleep(2); printf("PARENT: sending SIGSTOP\n"); kill(pid,SIGSTOP); diff --git a/qa/lib/newlib/204-signals.c b/qa/lib/newlib/204-signals.c index ebbe7e7..cf2c2b2 100644 --- a/qa/lib/newlib/204-signals.c +++ b/qa/lib/newlib/204-signals.c @@ -48,16 +48,16 @@ main() { printf("Child going to loop...\n"); write(p[1], "", 1); - sys_close(p[1]); - sys_close(p[0]); + close(p[1]); + close(p[0]); for(;;); /* loop for ever */ } else /* parent */ { signal(SIGCHLD,sigchld); read(p[0], &dummy, 1); - sys_close(p[1]); - sys_close(p[0]); + close(p[1]); + close(p[0]); printf("PARENT: sending SIGHUP\n"); kill(pid,SIGHUP); sleep(3); /* pause for 3 secs */ diff --git a/qa/lib/newlib/build.json b/qa/lib/newlib/build.json index c95559c..ced3e75 100644 --- a/qa/lib/newlib/build.json +++ b/qa/lib/newlib/build.json @@ -4,6 +4,7 @@ "/arch/$ARCH/include/cflags.json" ], "Cflags": [ + "-isystem", "/posix/lib/gcc/x86_64-jehanne/9.2.0/include", "-fstack-check", "-fstack-protector-all", "/pkgs/newlib/x86_64-jehanne/lib/libc.a", @@ -15,8 +16,7 @@ ], "Oflags": [ "-static", - "-lposix", - "-lc" + "-lposix" ], "Install": "/arch/$ARCH/qa/lib/newlib", "Post": [ @@ -71,6 +71,7 @@ "/arch/$ARCH/include/cflags.json" ], "Cflags": [ + "-isystem", "/posix/lib/gcc/x86_64-jehanne/9.2.0/include", "-fstack-check", "-fstack-protector-all", "/pkgs/newlib/x86_64-jehanne/lib/libc.a", @@ -83,8 +84,7 @@ ], "Oflags": [ "-static", - "-lposix", - "-lc" + "-lposix" ], "Install": "/arch/$ARCH/qa/lib/newlib/sigchld", "Post": [ diff --git a/qa/lib/newlib/testsuite/build.json b/qa/lib/newlib/testsuite/build.json index 6976f47..9d06b52 100644 --- a/qa/lib/newlib/testsuite/build.json +++ b/qa/lib/newlib/testsuite/build.json @@ -4,6 +4,7 @@ "/arch/$ARCH/include/cflags.json" ], "Cflags": [ + "-isystem", "/posix/lib/gcc/x86_64-jehanne/9.2.0/include", "-iquote", "/hacking/cross/pkgs/newlib/src/newlib/testsuite/include/", "-fstack-check", "-Wno-unused-variable", @@ -18,8 +19,7 @@ ], "Oflags": [ "-static", - "-lposix", - "-lc" + "-lposix" ], "Post": [ "mkdir -p $JEHANNE/arch/$ARCH/qa/lib/newlib/testsuite", diff --git a/sys/src/kern/amd64/usbohci.c b/sys/src/kern/amd64/usbohci.c index 5d99068..4180120 100644 --- a/sys/src/kern/amd64/usbohci.c +++ b/sys/src/kern/amd64/usbohci.c @@ -1178,7 +1178,7 @@ qhinterrupt(Ctlr * _, Ep *ep, Qio *io, Td *td, int __) td->ctrl &= ~(Tdccmask << Tdccshift); break; } - /* else fall; it's an error */ + /* Else falls through */ /* it's an error */ case Tdcrc: case Tdbitstuff: case Tdbadtog: