Subject: Rick's diffs for 2.9 on the PROs

From: Charlie C. Kim <columbia!cucca!cck>
Date: Thu, 21 Nov 85 02:07:20 est

*** clock.c	Fri Feb 22 11:57:08 1985
--- /usr/src/sys/sys/clock.c	Tue Feb 26 19:10:10 1985
***************
*** 70,93
  caddr_t pc;
  {
  	register a;
  	mapinfo	map;
  	extern caddr_t waitloc;
  	extern char *panicstr;
  
  	/*
  	 * restart clock
  	 */
- #if	PDP11 == 21
- 	while (*((int *)0173024) & 0200) ;
- 	a = *((int *)0173030);
- #else
  	if(lks)
  		*lks = 0115;
  #endif
  	/*
  	 * ensure normal mapping of kernel data
  	 */
  	savemap(map);
  
  #ifdef	DISPLAY
  	/*

--- 70,89 -----
  caddr_t pc;
  {
  	register a;
  	mapinfo	map;
  	extern caddr_t waitloc;
  	extern char *panicstr;
  
  	/*
  	 * restart clock
  	 */
  	if(lks)
  		*lks = 0115;
  	/*
  	 * ensure normal mapping of kernel data
  	 */
  	savemap(map);
  
  #ifdef	DISPLAY
  	/*
  	 * display register
***************
*** 76,96
  
  	/*
  	 * restart clock
  	 */
  #if	PDP11 == 21
  	while (*((int *)0173024) & 0200) ;
  	a = *((int *)0173030);
  #else
  	if(lks)
  		*lks = 0115;
- #endif
  	/*
  	 * ensure normal mapping of kernel data
  	 */
  	savemap(map);
  
  #ifdef	DISPLAY
  	/*
  	 * display register
  	 */
  	display();

--- 72,91 -----
  	register a;
  	mapinfo	map;
  	extern caddr_t waitloc;
  	extern char *panicstr;
  
  	/*
  	 * restart clock
  	 */
  	if(lks)
  		*lks = 0115;
  	/*
  	 * ensure normal mapping of kernel data
  	 */
  	savemap(map);
  
  #ifdef	DISPLAY
  	/*
  	 * display register
  	 */
  	display();
*** machdep.c	Wed Jan 23 17:13:15 1985
--- /usr/src/sys/sys/machdep.c	Tue Feb 26 19:12:08 1985
***************
*** 84,106

  /*
   * Machine dependent startup code
   */
  startup()
  {
  	register memaddr i, freebase;
  	extern	end;
  
- #if	PDP11 == 21
- 	ivinit();
- #endif
  #ifndef	NOKA5
  	saveseg5(seg5);		/* must be done before clear() is called */
  	if (&remap_area > SEG5)
  		panic("&remap_area > 0120000");
  #else
  	if (&end > SEG5)
  		panic("_end > 0120000");
  #endif
  
  #if PDP11 <= 22

--- 84,103 -----

  /*
   * Machine dependent startup code
   */
  startup()
  {
  	register memaddr i, freebase;
  	extern	end;
  
  #ifndef	NOKA5
  	saveseg5(seg5);		/* must be done before clear() is called */
  	if (&remap_area > SEG5)
  		panic("&remap_area > 0120000");
  #else
  	if (&end > SEG5)
  		panic("_end > 0120000");
  #endif
  
  	/*
***************
*** 96,118
  #endif
  #ifndef	NOKA5
  	saveseg5(seg5);		/* must be done before clear() is called */
  	if (&remap_area > SEG5)
  		panic("&remap_area > 0120000");
  #else
  	if (&end > SEG5)
  		panic("_end > 0120000");
  #endif
  
- #if PDP11 <= 22
- 	*SSR3 = 020;		/* Enable 22 bit memory mgmnt */
- #endif
  	/*
  	 * zero and free all of core
  	 */
  	i = freebase = *ka6 + USIZE;
  	UISD[0] = ((stoc(1) - 1) << 8) | RW;
  	for (;;) {
  		UISA[0] = i;
  		if (fuibyte((caddr_t)0) < 0)
  			break;
  		maxmem++;

--- 93,112 -----
  
  #ifndef	NOKA5
  	saveseg5(seg5);		/* must be done before clear() is called */
  	if (&remap_area > SEG5)
  		panic("&remap_area > 0120000");
  #else
  	if (&end > SEG5)
  		panic("_end > 0120000");
  #endif
  
  	/*
  	 * zero and free all of core
  	 */
  	i = freebase = *ka6 + USIZE;
  	UISD[0] = ((stoc(1) - 1) << 8) | RW;
  	for (;;) {
  		UISA[0] = i;
  		if (fuibyte((caddr_t)0) < 0)
  			break;
  		maxmem++;
***************
*** 116,138
  		if (fuibyte((caddr_t)0) < 0)
  			break;
  		maxmem++;
  		i++;
  		/*
  		 * avoid testing locations on the IO page if possible,
  		 * since some people have dz's at 0160000 (0760000).
  		 * (3968 is btoc(248K); the macro doesn't do longs.)
  		 * (65408 is btoc(4088K))
  		 */
- #if PDP11 <= 22
- 		if (!ubmap && i >= 0xff80)
- #else
  		if (!ubmap && i >= 3968)
  #endif
  			break;
  	}
  	clear(freebase, i - freebase);
  	mfree(coremap, i - freebase, freebase);
  	physmem = i;
  #define B  (size_t)(((long)nbuf * (bsize)) / ctob(1))
  	if ((bpaddr = malloc(coremap, B)) == 0)
  		panic("buffers");

--- 110,129 -----
  		if (fuibyte((caddr_t)0) < 0)
  			break;
  		maxmem++;
  		i++;
  		/*
  		 * avoid testing locations on the IO page if possible,
  		 * since some people have dz's at 0160000 (0760000).
  		 * (3968 is btoc(248K); the macro doesn't do longs.)
  		 * (65408 is btoc(4088K))
  		 */
  		if (!ubmap && i >= 3968)
  			break;
  	}
  	clear(freebase, i - freebase);
  	mfree(coremap, i - freebase, freebase);
  	physmem = i;
  #define B  (size_t)(((long)nbuf * (bsize)) / ctob(1))
  	if ((bpaddr = malloc(coremap, B)) == 0)
  		panic("buffers");
  	maxmem -= B;
***************
*** 120,140
  		/*
  		 * avoid testing locations on the IO page if possible,
  		 * since some people have dz's at 0160000 (0760000).
  		 * (3968 is btoc(248K); the macro doesn't do longs.)
  		 * (65408 is btoc(4088K))
  		 */
  #if PDP11 <= 22
  		if (!ubmap && i >= 0xff80)
  #else
  		if (!ubmap && i >= 3968)
- #endif
  			break;
  	}
  	clear(freebase, i - freebase);
  	mfree(coremap, i - freebase, freebase);
  	physmem = i;
  #define B  (size_t)(((long)nbuf * (bsize)) / ctob(1))
  	if ((bpaddr = malloc(coremap, B)) == 0)
  		panic("buffers");
  	maxmem -= B;
  #undef	B

--- 111,130 -----
  			break;
  		maxmem++;
  		i++;
  		/*
  		 * avoid testing locations on the IO page if possible,
  		 * since some people have dz's at 0160000 (0760000).
  		 * (3968 is btoc(248K); the macro doesn't do longs.)
  		 * (65408 is btoc(4088K))
  		 */
  		if (!ubmap && i >= 3968)
  			break;
  	}
  	clear(freebase, i - freebase);
  	mfree(coremap, i - freebase, freebase);
  	physmem = i;
  #define B  (size_t)(((long)nbuf * (bsize)) / ctob(1))
  	if ((bpaddr = malloc(coremap, B)) == 0)
  		panic("buffers");
  	maxmem -= B;
  #undef	B
***************
*** 338,361
  
  bad:
  	u.u_error = EINVAL;
  }
  
  /*
   * Determine whether clock is attached. If so, start it.
   */
  clkstart()
  {
- #if	PDP11 == 21
- 	proclock();
- 	lks = 0;
- #else
  	lks = LKS;
  	if (fioword((caddr_t)lks) == -1) {
  		lks = KW11P_CSR;
  		if (fioword((caddr_t)lks) == -1) {
  #ifndef	SHORTPRT
  			printf("no clock??\n");
  #else
  			printf("nocl\n");
  #endif	SHORTPRT
  			lks = 0;

--- 328,347 -----
  
  bad:
  	u.u_error = EINVAL;
  }
  
  /*
   * Determine whether clock is attached. If so, start it.
   */
  clkstart()
  {
  	lks = LKS;
  	if (fioword((caddr_t)lks) == -1) {
  		lks = KW11P_CSR;
  		if (fioword((caddr_t)lks) == -1) {
  #ifndef	SHORTPRT
  			printf("no clock??\n");
  #else
  			printf("nocl\n");
  #endif	SHORTPRT
  			lks = 0;
***************
*** 356,376
  #ifndef	SHORTPRT
  			printf("no clock??\n");
  #else
  			printf("nocl\n");
  #endif	SHORTPRT
  			lks = 0;
  		}
  	}
  	if (lks)
  		*lks = 0115;
- #endif
  }
  
  #ifndef	ENABLE34
  /*
   * Fetch a word from an address on the I/O page,
   * returning -1 if address does not exist.
   */
  fioword(addr)
  {
  	register val, saveUI7, saveUD7;

--- 342,361 -----
  #ifndef	SHORTPRT
  			printf("no clock??\n");
  #else
  			printf("nocl\n");
  #endif	SHORTPRT
  			lks = 0;
  		}
  	}
  	if (lks)
  		*lks = 0115;
  }
  
  #ifndef	ENABLE34
  /*
   * Fetch a word from an address on the I/O page,
   * returning -1 if address does not exist.
   */
  fioword(addr)
  {
  	register val, saveUI7, saveUD7;
*** main.c	Wed Jan 23 17:12:39 1985
--- /usr/src/sys/sys/main.c	Tue Feb 26 19:12:59 1985
***************
*** 36,56
   *	turn on clock
   *	hand craft 0th process
   *	call all initialization routines
   *	fork - process 0 to schedule
   *	     - process 1 execute bootstrap
   */
  main()
  {
  	extern char version[];
  
- #if	PDP11 > 21
  	printf("\n%s", version);
  #endif
  	startup();
  #if	PDP11 == 21
  	printf("\n%s", version);
  #endif
  
  	/*
  	 * set up system process
  	 */

--- 36,55 -----
   *	turn on clock
   *	hand craft 0th process
   *	call all initialization routines
   *	fork - process 0 to schedule
   *	     - process 1 execute bootstrap
   */
  main()
  {
  	extern char version[];
  
  	printf("\n%s", version);
  	startup();
  
  	/*
  	 * set up system process
  	 */
  	proc[0].p_addr = *ka6;
  #ifndef	VIRUS_VFORK
  	proc[0].p_size = USIZE;
  #endif
***************
*** 38,58
   *	call all initialization routines
   *	fork - process 0 to schedule
   *	     - process 1 execute bootstrap
   */
  main()
  {
  	extern char version[];
  
  #if	PDP11 > 21
  	printf("\n%s", version);
- #endif
  	startup();
  #if	PDP11 == 21
  	printf("\n%s", version);
  #endif
  
  	/*
  	 * set up system process
  	 */
  	proc[0].p_addr = *ka6;
  #ifndef	VIRUS_VFORK

--- 37,56 -----
   *	hand craft 0th process
   *	call all initialization routines
   *	fork - process 0 to schedule
   *	     - process 1 execute bootstrap
   */
  main()
  {
  	extern char version[];
  
  	printf("\n%s", version);
  	startup();
  
  	/*
  	 * set up system process
  	 */
  	proc[0].p_addr = *ka6;
  #ifndef	VIRUS_VFORK
  	proc[0].p_size = USIZE;
  #endif
  	proc[0].p_stat = SRUN;
***************
*** 40,62
   *	     - process 1 execute bootstrap
   */
  main()
  {
  	extern char version[];
  
  #if	PDP11 > 21
  	printf("\n%s", version);
  #endif
  	startup();
- #if	PDP11 == 21
- 	printf("\n%s", version);
- #endif
  
  	/*
  	 * set up system process
  	 */
  	proc[0].p_addr = *ka6;
  #ifndef	VIRUS_VFORK
  	proc[0].p_size = USIZE;
  #endif
  	proc[0].p_stat = SRUN;
  	proc[0].p_flag |= SLOAD|SSYS;

--- 38,57 -----
   *	call all initialization routines
   *	fork - process 0 to schedule
   *	     - process 1 execute bootstrap
   */
  main()
  {
  	extern char version[];
  
  	printf("\n%s", version);
  	startup();
  
  	/*
  	 * set up system process
  	 */
  	proc[0].p_addr = *ka6;
  #ifndef	VIRUS_VFORK
  	proc[0].p_size = USIZE;
  #endif
  	proc[0].p_stat = SRUN;
  	proc[0].p_flag |= SLOAD|SSYS;
***************
*** 145,167
  	fp->s_flock = 0;
  	fp->s_ilock = 0;
  	fp->s_ronly = 0;
  #ifdef	UCB_IHASH
  	fp->s_lasti = 1;
  	fp->s_nbehind = 0;
  #endif
  	fp->s_fsmnt[0] = '/';
  	for (i = 1; i < sizeof(fp->s_fsmnt); i++)
  		fp->s_fsmnt[i] = 0;
- #if PDP11 == 21
- 	if (time == 0)
- #endif
  	time = fp->s_time;
  	bootime = time;
  }
  
  memaddr bpaddr;		/* physical click-address of buffers */
  
  /*
   * Initialize the buffer I/O system by freeing
   * all buffers and setting all device buffer lists to empty.
   */

--- 140,159 -----
  	fp->s_flock = 0;
  	fp->s_ilock = 0;
  	fp->s_ronly = 0;
  #ifdef	UCB_IHASH
  	fp->s_lasti = 1;
  	fp->s_nbehind = 0;
  #endif
  	fp->s_fsmnt[0] = '/';
  	for (i = 1; i < sizeof(fp->s_fsmnt); i++)
  		fp->s_fsmnt[i] = 0;
  	time = fp->s_time;
  	bootime = time;
  }
  
  memaddr bpaddr;		/* physical click-address of buffers */
  
  /*
   * Initialize the buffer I/O system by freeing
   * all buffers and setting all device buffer lists to empty.
   */
*** sys3.c	Wed Jan 23 17:12:57 1985
--- /usr/src/sys/sys/sys3.c	Tue Feb 26 19:13:27 1985
***************
*** 263,285
  	register struct inode *ip;
  	register struct mount *mp;
  	register struct buf *bp;
  	struct buf *dp;
  
  	dev = getmdev();
  	if (u.u_error || !suser())
  		return;
  	xumount(dev);	/* remove unused sticky files from text table */
  	update();
- #if	PDP11 <= 22
- 	delay(2);
- #endif
  	for (mp = mount; mp < mountNMOUNT; mp++)
  		if (mp->m_inodp != NULL && dev == mp->m_dev) {
  			for(ip = inode; ip < inodeNINODE; ip++)
  				if (ip->i_number != 0 && dev == ip->i_dev) {
  					u.u_error = EBUSY;
  					return;
  				}
  			(*bdevsw[major(dev)].d_close)(dev, 0);
  			dp = bdevsw[major(dev)].d_tab;
  			for (bp = dp->b_forw; bp != dp; bp = bp->b_forw) {

--- 263,282 -----
  	register struct inode *ip;
  	register struct mount *mp;
  	register struct buf *bp;
  	struct buf *dp;
  
  	dev = getmdev();
  	if (u.u_error || !suser())
  		return;
  	xumount(dev);	/* remove unused sticky files from text table */
  	update();
  	for (mp = mount; mp < mountNMOUNT; mp++)
  		if (mp->m_inodp != NULL && dev == mp->m_dev) {
  			for(ip = inode; ip < inodeNINODE; ip++)
  				if (ip->i_number != 0 && dev == ip->i_dev) {
  					u.u_error = EBUSY;
  					return;
  				}
  			(*bdevsw[major(dev)].d_close)(dev, 0);
  			dp = bdevsw[major(dev)].d_tab;
  			for (bp = dp->b_forw; bp != dp; bp = bp->b_forw) {
*** sys4.c	Thu Jan 31 17:16:12 1985
--- /usr/src/sys/sys/sys4.c	Tue Feb 26 19:13:57 1985
***************
*** 61,83
  stime()
  {
  	register struct a {
  		time_t	time;
  	} *uap;
  
  	if (suser()) {
  		uap = (struct a *)u.u_ap;
  		bootime += uap->time - time;
  		time = uap->time;
- #if	PDP11 == 21
- 		sdtime();
- #endif
  	}
  }
  
  setuid()
  {
  	register uid;
  	struct a {
  		int	uid;
  	};

--- 61,80 -----
  stime()
  {
  	register struct a {
  		time_t	time;
  	} *uap;
  
  	if (suser()) {
  		uap = (struct a *)u.u_ap;
  		bootime += uap->time - time;
  		time = uap->time;
  	}
  }
  
  setuid()
  {
  	register uid;
  	struct a {
  		int	uid;
  	};