;;; -*- Mode: Common-Lisp; Package: SI; Base: 8.; Patch-File: T -*-

;;; Reason: Modified configure-page-bands to collect page bands with CPU types Explorer and Explorer II. [9911]

;;;                           RESTRICTED RIGHTS LEGEND
;;;
;;; Use, duplication, or disclosure by the Government is subject to
;;; restrictions as set forth in subdivision (c)(1)(ii) of the Rights in
;;; Technical Data and Computer Software clause at 52.227-7013.
;;;
;;;   TEXAS INSTRUMENTS INCORPORATED      
;;;   P.O. BOX 2909, M/S 2151             
;;;   AUSTIN, TEXAS 78769                 
;;;
;;; Copyright (C) 1989 Texas Instruments Incorporated.
;;; All rights reserved.

;;; Patch file for VIRTUAL-MEMORY version 6.3
;;; Written 11/29/89 09:40:39 by BERGER,
;;; while running on ARIES from band LODA
;;; With SYSTEM 6.25, VIRTUAL-MEMORY 6.2, EH 6.5, MAKE-SYSTEM 6.2, MICRONET 6.0, LOCAL-FILE 6.1,
;;;  BASIC-PATHNAME 6.2, NETWORK-SUPPORT-COLD 6.2, BASIC-NAMESPACE 6.7, NETWORK-NAMESPACE 6.0,
;;;  DISK-IO 6.1, DISK-LABEL 6.0, BASIC-FILE 6.6, MAC-PATHNAME 6.0, NETWORK-PATHNAME 6.0,
;;;  COMPILER 6.14, TV 6.19, DATALINK 6.0, CHAOSNET 6.5, GC 6.3, MEMORY-AUX 6.0, NVRAM 6.2,
;;;  SYSLOG 6.2, STREAMER-TAPE 6.5, UCL 6.0, INPUT-EDITOR 6.0, METER 6.1, ZWEI 6.8,
;;;  DEBUG-TOOLS 6.3, NETWORK-SUPPORT 6.0, NETWORK-SERVICE 6.2, DATALINK-DISPLAYS 6.0,
;;;  FONT-EDITOR 6.1, SERIAL 6.0, PRINTER 6.3, MAC-PRINTER-TYPES 6.1, PRINTER-TYPES 6.2,
;;;  IMAGEN 6.1, SUGGESTIONS 6.1, MAIL-DAEMON 6.3, MAIL-READER 6.6, TELNET 6.0, VT100 6.0,
;;;  NAMESPACE-EDITOR 6.4, PROFILE 6.2, VISIDOC 6.5, TI-CLOS 6.26, CLEH 6.5, IP 3.56,
;;;  Experimental CLX 6.7, CLUE 6.35, X11M 6.17, Experimental BUG 11.17,  microcode 429,
;;;  Band Name: REl 6.0 timebase

#!C
; From file PAGE-DEVICE.LISP#> MEMORY-MANAGEMENT; SYS:
#8R SYSTEM#:
(COMPILER-LET ((*PACKAGE* (FIND-PACKAGE "SYSTEM"))
                          (SI:*LISP-MODE* :COMMON-LISP)
                          (*READTABLE* COMMON-LISP-READTABLE)
                          (SI:*READER-SYMBOL-SUBSTITUTIONS* *COMMON-LISP-SYMBOL-SUBSTITUTIONS*))
  (COMPILER#:PATCH-SOURCE-FILE "SYS: MEMORY-MANAGEMENT; PAGE-DEVICE.#"


(DEFUN configure-page-bands ()
  "Find all page bands and add to swap device table"
  (LET ((lod-band-formatter-number
	  (LDB (BYTE 3. 3.) (get-real-unit *default-disk-unit*)))
	on-different-formatter
	on-same-formatter-but-different-unit
	on-same-formatter-and-unit)
    (DOLIST (band
	      (DOLIST (item (append (GET-PARTITION-LIST %bt-page-band %cpu-explorer)
				    (GET-PARTITION-LIST %bt-page-band %cpu-ti-explorer-ii))  ; DAB 11-29-89 Use Exp 2 bands
			    (APPEND on-different-formatter
				    on-same-formatter-but-different-unit
				    on-same-formatter-and-unit))
		;; only consider page bands with length > 0
		(WHEN (> (NTH 4 item) 0)
		  (IF (NEQ (LDB (BYTE 3. 3.) (GET-REAL-UNIT (CAR item))) lod-band-formatter-number)
		      ;; different formatter: best
		      (PUSH item on-different-formatter)
		      (IF (NEQ *default-disk-unit* (CAR item))
			  ;; different unit of same formatter: second best
			  (PUSH item on-same-formatter-but-different-unit)
			  ;; on same disk as lod band: worst
			  (PUSH item on-same-formatter-and-unit))))))
      ;; band is (unit name type start size comment)
      ;; Add bands in "best" order
      (IF (< number-of-page-devices maximum-page-devices)
	  (UNLESS (band-already-added? (get-real-unit (CAR band))	; Just in case we come through here twice...
				       (NTH 3 band))
	    (%add-page-device (get-real-unit (CAR band))
			      (NTH 3 band)	
			      (NTH 4 band)))
	  ;; Signal proceedable error if too many page bands.
	  (PROGN
	    (FSIGNAL "Too many page bands, system only allows ~d page bands."
		     maximum-page-devices)
	    (PRINT "Proceeding without adding page band"))))
  ))
))
