;;; -*- Mode:LISP; Package:SYSTEM-INTERNALS; Cold-Load:T; Base:8; Readtable:ZL -*- ;;; This file contains the definitions for the share mini ethernet system. ;;; Idea is, this form of mini is the secondary processor on a 2x2 or 3x3. (defun mini-share-ethernet-reset () (set-up-chaos-channels) ;*** chaos address in proc-conf set up from chaos:my-address. (setq *mini-local-host* chaos:my-address) ) (defun mini-share-transmit-16b-array (from-ether-host to-ether-host pkt nwords e-type) ;we just send a chaos pkt and rely on sharing host for ethernet conversion. ; so we ignore below args. from-ether-host to-ether-host nwords ;(and (share-mode-active-p) ; (not (null (op-chaos-xmit-ctl op))) ) (if (= e-type #x408) ;ignore anything but chaos pkt. (let ((op (mini-share-op-of-ether-owner))) (do ((cs-xmit (op-chaos-xmit-ctl op)) (transmit-start-time (%fixnum-microsecond-time))) ((> (time-difference (%fixnum-microsecond-time) transmit-start-time) *share-chaos-transmit-buffer-timeout-period*)) (cond ((zerop (ldb %%chaos-share-dev-valid-bit (%chaos-share-csr cs-xmit))) (copy-array-portion pkt 0 chaos:max-words-per-pkt (op-chaos-xmit-pkt op) 0 chaos:max-words-per-pkt) (setf (%chaos-share-pkt-length cs-xmit) (+ (chaos:pkt-nbytes pkt) 16.)) ; + chaos header (setf (ldb %%chaos-share-dev-valid-bit (%chaos-share-csr cs-xmit)) 1) (share-chaos-interrupt op) (return nil))))))) (defun mini-share-receive-ethernet-16b-array (pkt) (let ((op (mini-share-op-of-ether-owner))) (copy-array-portion (op-chaos-rcv-pkt op) 0 chaos:max-words-per-pkt pkt 0 chaos:max-words-per-pkt) (setf (ldb %%chaos-share-dev-valid-bit (%chaos-share-csr (op-chaos-rcv-ctl op))) 0) (share-chaos-interrupt op) pkt)) (defun mini-share-pkt-available () (let ((op (mini-share-op-of-ether-owner))) (and (not (null (op-chaos-rcv-ctl op))) (not (zerop (ldb %%chaos-share-dev-valid-bit (%chaos-share-csr (op-chaos-rcv-ctl op)))))))) (defun mini-share-op-of-ether-owner () (cond ((or (not (boundp '*ethernet-hardware-controller*)) (null *ethernet-hardware-controller*)) (set-processor-owning-ethernet :find))) *ethernet-hardware-controller* )