Browse Source

Reintroducing 9/amd64, removing numcores, types adapted (#748)

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>
Álvaro Jurado 6 years ago
parent
commit
2db419b9ea

+ 0 - 13
sys/src/9/amd64/.gitignore

@@ -1,13 +0,0 @@
-/init.h
-/init
-/systab.c
-/bootamd64cpu.c
-/tags
-/amd64l.h
-/harvey
-/harvey.32bit
-/harvey.asm
-/amd64cpu.c
-/errstr.h
-/ksyms.map
-/nvram

+ 1 - 1
sys/src/9/amd64/core.json

@@ -61,7 +61,7 @@
 			"vsvm.c",
 			"l64v.S",
 			"l64fpu.S",
-			"cpuidamd64.S",
+			"cpuid$ARCH.S",
 			"l64acidt.S",
 			"l64idt.S",
 			"l64vsyscall.S",

+ 4 - 4
sys/src/9/amd64/dat.h

@@ -307,15 +307,15 @@ struct Mach
 	void*	gdt;
 	void*	tss;
 
-	uint32_t	ticks;			/* of the clock since boot time */
+	uint64_t	ticks;			/* of the clock since boot time */
 	Label	sched;			/* scheduler wakeup */
 	Lock	alarmlock;		/* access to alarm list */
 	void*	alarm;			/* alarms bound to this clock */
 	int	inclockintr;
 
 	Proc*	readied;		/* old runproc, only relevant if kernel booted with nosmp (-n append) */
-	uint32_t   schedticks;		/* next forced context switch, same as above */
-	uint32_t	qstart;			/* time when up started running */
+	uint64_t   schedticks;		/* next forced context switch, same as above */
+	uint64_t	qstart;			/* time when up started running */
 	int	qexpired;		/* quantum expired */
 
 	int	tlbfault;
@@ -397,7 +397,7 @@ struct Sys {
 			int		nc[NIXROLES];		/* number of online processors */
 			int		nmach;
 			int		load;
-			uint32_t	ticks;			/* of the clock since boot time */
+			uint64_t	ticks;			/* of the clock since boot time */
 		};
 		unsigned char	syspage[4*KiB];
 	};

+ 1 - 2
sys/src/9/amd64/devarch.c

@@ -545,7 +545,6 @@ void
 archinit(void)
 {
 	addarchfile("cputype", 0444, cputyperead, nil);
-	addarchfile("numcores", 0444, numcoresread, nil);
 	addarchfile("mtags", 0444, mtagsread, nil);
 }
 
@@ -622,7 +621,7 @@ delay(int millisecs)
  *  performance measurement ticks.  must be low overhead.
  *  doesn't have to count over a second.
  */
-uint32_t
+uint64_t
 perfticks(void)
 {
 	uint64_t x;

+ 1 - 1
sys/src/9/amd64/inith.json

@@ -12,7 +12,7 @@
 			"-mcmodel=small"
 		],
 		"Libs": [
-			"/amd64/lib/libc.a"
+			"/$ARCH/lib/libc.a"
 		],
 		"Oflags": [
 			"-e_main",

+ 0 - 13
sys/src/9/amd64/syscall.c

@@ -349,19 +349,6 @@ syscall(unsigned int scallnr, Ureg *ureg)
 	if (0) hi("call syscall!\n");
 		systab[scallnr].f(&ar0, a0, a1, a2, a3, a4, a5);
 	if (0) hi("it returned!\n");
-		if(scallnr == SYSR1){
-			/*
-			 * BUG: must go when ron binaries go.
-			 * NIX: Returning from execac().
-			 * This means that the process is back to the
-			 * time sharing core. However, the process did
-			 * already return from the system call, when dispatching
-			 * the user code to the AC. The only thing left is to
-			 * return. The user registers should be ok, because
-			 * up->dbgreg has been the user context for the process.
-			 */
-			return;
-		}
 		poperror();
 	}
 	else{

+ 1 - 1
sys/src/9/amd64/trap.c

@@ -331,7 +331,7 @@ void
 intrtime(int vno)
 {
 	Proc *up = externup();
-	uint32_t diff, x;		/* should be uint64_t */
+	uint64_t diff, x;
 
 	x = perfticks();
 	diff = x - machp()->perf.intrts;

+ 2 - 2
sys/src/9/amd64/usbohci.c

@@ -206,7 +206,7 @@ struct Qio
 	int	toggle;		/* Tddata0/Tddata1 */
 	uint32_t	usbid;		/* device/endpoint address */
 	int	tok;		/* Tdsetup, Tdtokin, Tdtokout */
-	int32_t	iotime;		/* last I/O time; to hold interrupt polls */
+	int64_t	iotime;		/* last I/O time; to hold interrupt polls */
 	int	debug;		/* for the endpoint */
 	char*	err;		/* error status */
 	int	state;		/* Qidle -> Qinstall -> Qrun -> Qdone | Qclose */
@@ -1618,7 +1618,7 @@ epread(Ep *ep, void *a, int32_t count)
 	Ctlio *cio;
 	Qio *io;
 	char buf[80];
-	uint32_t delta;
+	uint64_t delta;
 
 	if(ep->aux == nil)
 		panic("epread: not open");