shithub: drawterm-fdroid

Download patch

ref: 023a0ce70099b0cc01c0956377def3238a6a947a
parent: bc9f9803fe3a2ed14cf480fb2787f51861d82abc
author: cinap_lenrek <[email protected]>
date: Sun Jan 15 17:45:25 EST 2017

remove more old cruft

--- a/kern/dat.h
+++ b/kern/dat.h
@@ -45,20 +45,7 @@
 {
 	ulong	nmach;		/* processors */
 	ulong	nproc;		/* processes */
-	ulong	monitor;	/* has monitor? */
-	ulong	npage0;		/* total physical pages of memory */
-	ulong	npage1;		/* total physical pages of memory */
-	ulong	npage;		/* total physical pages of memory */
-	ulong	upages;		/* user page pool */
-	ulong	nimage;		/* number of page cache image headers */
-	ulong	nswap;		/* number of swap pages */
-	int	nswppo;		/* max # of pageouts per segment pass */
-	ulong	base0;		/* base of bank 0 */
-	ulong	base1;		/* base of bank 1 */
-	ulong	copymode;	/* 0 is copy on write, 1 is copy on reference */
-	ulong	ialloc;		/* max interrupt time allocation in bytes */
 	ulong	pipeqsize;	/* size in bytes of pipe queues */
-	int	nuart;		/* number of uart devices */
 };
 
 struct Label
--- a/kern/data.c
+++ b/kern/data.c
@@ -6,22 +6,9 @@
 
 Conf conf = 
 {
-	1,
-	100,
-	0,
-	1024*1024*1024,
-	1024*1024*1024,
-	1024*1024*1024,
-	1024*1024*1024,
-	1024*1024*1024,
-	1024*1024*1024,
-	1024*1024*1024,
-	1024*1024*1024,
-	1024*1024*1024,
-	1024*1024*1024,
-	1024*1024*1024,
-	1024*1024*1024,
-	0,
+	1,	/* processors */
+	100,	/* processes */
+	0,	/* size in bytes of pipe queues */
 };
 
 char *eve = "eve";
--- a/kern/devcons.c
+++ b/kern/devcons.c
@@ -731,7 +731,7 @@
 		ct = lookupcmd(cb, rebootmsg, nelem(rebootmsg));
 		switch(ct->index) {
 		case CMreboot:
-			rebootcmd(cb->nf-1, cb->f+1);
+			error(Egreg);
 			break;
 		case CMpanic:
 			panic("/dev/reboot");
--- a/kern/fns.h
+++ b/kern/fns.h
@@ -27,8 +27,6 @@
 void		cmderror(Cmdbuf*, char*);
 int		cmount(Chan**, Chan*, int, char*);
 void		cnameclose(Cname*);
-void		confinit(void);
-void		confinit1(int);
 Block*		concatblock(Block*);
 Block*		copyblock(Block*, int);
 void		cunmount(Chan*, Chan*);
@@ -72,7 +70,6 @@
 char*		getconfenv(void);
 long		hostdomainwrite(char*, int);
 long		hostownerwrite(char*, int);
-void		iallocinit(void);
 Block*		iallocb(int);
 void		ilock(Lock*);
 void		iunlock(Lock*);
@@ -181,9 +178,6 @@
 ulong		randomread(void*, ulong);
 int		readnum(ulong, char*, ulong, ulong, int);
 int		readstr(ulong, char*, ulong, char*);
-void		rebootcmd(int, char**);
-void		reboot(void*, void*, ulong);
-void		renameuser(char*, char*);
 int		return0(void*);
 void		rlock(RWlock*);
 void		runlock(RWlock*);
@@ -201,8 +195,6 @@
 int		splhi(void);
 int		spllo(void);
 void		splx(int);
-void		splxpc(int);
-char*		srvname(Chan*);
 Block*		trimblock(Block*, int, int);
 long		unionread(Chan*, void*, long);
 void		unlock(Lock*);
--- a/kern/stub.c
+++ b/kern/stub.c
@@ -28,13 +28,6 @@
 	return 0;
 }
 
-void
-rebootcmd(int argc, char **argv)
-{
-	USED(argc);
-	USED(argv);
-}
-
 int
 userwrite(char *a, int n)
 {
--- a/libc/time.c
+++ b/libc/time.c
@@ -1,50 +1,12 @@
 #include <u.h>
 #include <libc.h>
 
-
-/*
- *  After a fork with fd's copied, both fd's are pointing to
- *  the same Chan structure.  Since the offset is kept in the Chan
- *  structure, the seek's and read's in the two processes can
- *  compete at moving the offset around.  Hence the unusual loop
- *  in the middle of this routine.
- */
-static long
-oldtime(long *tp)
-{
-	char b[20];
-	static int f = -1;
-	int i, retries;
-	long t;
-
-	memset(b, 0, sizeof(b));
-	for(retries = 0; retries < 100; retries++){
-		if(f < 0)
-			f = open("/dev/time", OREAD|OCEXEC);
-		if(f < 0)
-			break;
-		if(seek(f, 0, 0) < 0 || (i = read(f, b, sizeof(b))) < 0){
-			close(f);
-			f = -1;
-		} else {
-			if(i != 0)
-				break;
-		}
-	}
-	t = atol(b);
-	if(tp)
-		*tp = t;
-	return t;
-}
-
 long
 time(long *tp)
 {
 	vlong t;
 
-	t = nsec()/((vlong)1000000000);
-	if(t == 0)
-		t = oldtime(0);
+	t = nsec()/1000000000LL;
 	if(tp != nil)
 		*tp = t;
 	return t;