since the TC machines have switched to the MI zstty code.
-/* $OpenBSD: conf.c,v 1.92 2022/10/15 10:12:12 jsg Exp $ */
+/* $OpenBSD: conf.c,v 1.93 2023/02/06 11:16:22 miod Exp $ */
/* $NetBSD: conf.c,v 1.16 1996/10/18 21:26:57 cgd Exp $ */
/*-
#include "bio.h"
#include "lpt.h"
cdev_decl(lpt);
-cdev_decl(prom); /* XXX XXX XXX */
cdev_decl(wd);
cdev_decl(fd);
#include "cy.h"
cdev_notdef(), /* 20 */
cdev_notdef(), /* 21 */
cdev_notdef(), /* 22 */
- cdev_tty_init(1,prom), /* 23: XXX prom console */
+ cdev_notdef(), /* 23 reserved for PROM console */
cdev_audio_init(NAUDIO,audio), /* 24: generic audio I/O */
cdev_wsdisplay_init(NWSDISPLAY,wsdisplay), /* 25: workstation console */
cdev_tty_init(NCOM,com), /* 26: ns16550 UART */
-/* $OpenBSD: machdep.c,v 1.200 2023/01/02 19:09:17 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.201 2023/02/06 11:16:22 miod Exp $ */
/* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */
/*-
#endif
/* NO MORE FIRMWARE ACCESS ALLOWED */
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
- /*
- * XXX (unless _PMAP_MAY_USE_PROM_CONSOLE is defined and
- * XXX pmap_uses_prom_console() evaluates to non-zero.)
- */
-#endif
#ifndef SMALL_KERNEL
/*
* software use. We must determine if this cluster
* holds the kernel.
*/
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
- /*
- * XXX If the kernel uses the PROM console, we only use the
- * XXX memory after the kernel in the first system segment,
- * XXX to avoid clobbering prom mapping, data, etc.
- */
- if (!pmap_uses_prom_console() || physmem == 0) {
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
physmem += memc->mddt_pg_cnt;
pfn0 = memc->mddt_pfn;
pfn1 = memc->mddt_pfn + memc->mddt_pg_cnt;
#if 0
printf("Cluster %d contains kernel\n", i);
#endif
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
- if (!pmap_uses_prom_console()) {
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
if (pfn0 < kernstartpfn) {
/*
* There is a chunk before the kernel.
uvm_page_physload(pfn0, kernstartpfn,
pfn0, kernstartpfn, 0);
}
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
- }
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
if (kernendpfn < pfn1) {
/*
* There is a chunk after the kernel.
#endif
uvm_page_physload(pfn0, pfn1, pfn0, pfn1, 0);
}
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
- }
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
}
#ifdef DEBUG
void
consinit()
{
-
/*
* Everything related to console initialization is done
* in alpha_init().
*/
-#if defined(DIAGNOSTIC) && defined(_PMAP_MAY_USE_PROM_CONSOLE)
- printf("consinit: %susing prom console\n",
- pmap_uses_prom_console() ? "" : "not ");
-#endif
}
void
-/* $OpenBSD: pmap.c,v 1.88 2022/09/12 19:35:20 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.89 2023/02/06 11:16:22 miod Exp $ */
/* $NetBSD: pmap.c,v 1.154 2000/12/07 22:18:55 thorpej Exp $ */
/*-
#include <machine/atomic.h>
#include <machine/cpu.h>
-#if defined(_PMAP_MAY_USE_PROM_CONSOLE) || defined(MULTIPROCESSOR)
+#if defined(MULTIPROCESSOR)
#include <machine/rpb.h>
#endif
kernel_lev1map[l1pte_index(VPTBASE)] = pte;
VPT = (pt_entry_t *)VPTBASE;
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
- {
- extern pt_entry_t prom_pte; /* XXX */
- extern int prom_mapped; /* XXX */
-
- if (pmap_uses_prom_console()) {
- /*
- * XXX Save old PTE so we can remap the PROM, if
- * XXX necessary.
- */
- prom_pte = *(pt_entry_t *)ptaddr & ~PG_ASM;
- }
- prom_mapped = 0;
-
- /*
- * Actually, this code lies. The prom is still mapped, and will
- * remain so until the context switch after alpha_init() returns.
- */
- }
-#endif
-
/*
* Set up level 2 page table.
*/
(1UL << cpu_number()));
}
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-int
-pmap_uses_prom_console(void)
-{
-
-#if defined(NEW_SCC_DRIVER)
- return (cputype == ST_DEC_21000);
-#else
- return (cputype == ST_DEC_21000
- || cputype == ST_DEC_3000_300
- || cputype == ST_DEC_3000_500);
-#endif /* NEW_SCC_DRIVER */
-}
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
-
/*
* pmap_steal_memory: [ INTERFACE ]
*
-/* $OpenBSD: prom.c,v 1.16 2014/12/18 10:50:02 dlg Exp $ */
+/* $OpenBSD: prom.c,v 1.17 2023/02/06 11:16:22 miod Exp $ */
/* $NetBSD: prom.c,v 1.39 2000/03/06 21:36:05 thorpej Exp $ */
/*
void prom_enter(void);
void prom_leave(void);
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-int prom_mapped = 1; /* Is PROM still mapped? */
-
-pt_entry_t prom_pte, saved_pte[1]; /* XXX */
-static pt_entry_t *prom_lev1map(void);
-
-static pt_entry_t *
-prom_lev1map()
-{
- struct alpha_pcb *apcb;
-
- /*
- * Find the level 1 map that we're currently running on.
- */
- apcb = (struct alpha_pcb *)ALPHA_PHYS_TO_K0SEG(curpcb);
-
- return ((pt_entry_t *)ALPHA_PHYS_TO_K0SEG(apcb->apcb_ptbr << PGSHIFT));
-}
-#endif /* _PMAP_MAY_USE_PROM_CONSOLE */
-
void
init_prom_interface(struct rpb *rpb)
{
cn_tab = &promcons;
}
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-static void prom_cache_sync(void);
-#endif
-
void
prom_enter(void)
{
mtx_enter(&prom_lock);
-
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
- /*
- * If we have not yet switched out of the PROM's context
- * (i.e. the first one after alpha_init()), then the PROM
- * is still mapped, regardless of the `prom_mapped' setting.
- */
- if (prom_mapped == 0 && curpcb != 0) {
- if (!pmap_uses_prom_console())
- panic("prom_enter");
- {
- pt_entry_t *lev1map;
-
- lev1map = prom_lev1map(); /* XXX */
- saved_pte[0] = lev1map[0]; /* XXX */
- lev1map[0] = prom_pte; /* XXX */
- }
- prom_cache_sync(); /* XXX */
- }
-#endif
}
void
prom_leave(void)
{
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
- /*
- * See comment above.
- */
- if (prom_mapped == 0 && curpcb != 0) {
- if (!pmap_uses_prom_console())
- panic("prom_leave");
- {
- pt_entry_t *lev1map;
-
- lev1map = prom_lev1map(); /* XXX */
- lev1map[0] = saved_pte[0]; /* XXX */
- }
- prom_cache_sync(); /* XXX */
- }
-#endif
-
mtx_leave(&prom_lock);
}
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-static void
-prom_cache_sync(void)
-{
- ALPHA_TBIA();
- alpha_pal_imb();
-}
-#endif
-
/*
* promcnputc:
*
}
}
-/*
- * promcnlookc:
- *
- * See if prom has a real char and pass it back.
- */
-int
-promcnlookc(dev_t dev, char *cp)
-{
- prom_return_t ret;
-
- prom_enter();
- ret.bits = prom_getc(alpha_console);
- prom_leave();
- if (ret.u.status == 0 || ret.u.status == 1) {
- *cp = ret.u.retval;
- return 1;
- } else
- return 0;
-}
-
int
prom_getenv(int id, char *buf, int len)
{
+++ /dev/null
-/* $OpenBSD: promcons.c,v 1.19 2018/02/19 08:59:52 mpi Exp $ */
-/* $NetBSD: promcons.c,v 1.5 1996/11/13 22:20:55 cgd Exp $ */
-
-/*
- * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/ioctl.h>
-#include <sys/selinfo.h>
-#include <sys/tty.h>
-#include <sys/proc.h>
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/device.h>
-#include <sys/timeout.h>
-
-#include <dev/cons.h>
-
-#include <machine/rpb.h>
-#include <machine/prom.h>
-
-static struct tty *prom_tty[1];
-static struct timeout prom_to;
-
-void promstart(struct tty *);
-void promtimeout(void *);
-int promparam(struct tty *, struct termios *);
-cdev_decl(prom);
-cons_decl(prom);
-
-int
-promopen(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
-{
- int unit = minor(dev);
- struct tty *tp;
- int s;
- int error = 0, setuptimeout = 0;
-
- if (unit >= 1)
- return ENXIO;
-
- s = spltty();
-
- if (prom_tty[unit] == NULL) {
- tp = prom_tty[unit] = ttymalloc(0);
- } else
- tp = prom_tty[unit];
-
- tp->t_oproc = promstart;
- tp->t_param = promparam;
- tp->t_dev = dev;
- if ((tp->t_state & TS_ISOPEN) == 0) {
- tp->t_state |= TS_WOPEN|TS_CARR_ON;
- ttychars(tp);
- tp->t_iflag = TTYDEF_IFLAG;
- tp->t_oflag = TTYDEF_OFLAG;
- tp->t_cflag = TTYDEF_CFLAG|CLOCAL;
- tp->t_lflag = TTYDEF_LFLAG;
- tp->t_ispeed = tp->t_ospeed = 9600;
- ttsetwater(tp);
-
- setuptimeout = 1;
- } else if (tp->t_state&TS_XCLUDE && suser(p) != 0) {
- splx(s);
- return EBUSY;
- }
-
- splx(s);
-
- error = (*linesw[tp->t_line].l_open)(dev, tp, p);
- if (error == 0 && setuptimeout) {
- timeout_set(&prom_to, promtimeout, tp);
- timeout_add(&prom_to, 1);
- }
- return error;
-}
-
-int
-promclose(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
-{
- int unit = minor(dev);
- struct tty *tp = prom_tty[unit];
-
- timeout_del(&prom_to);
- (*linesw[tp->t_line].l_close)(tp, flag, p);
- ttyclose(tp);
- return 0;
-}
-
-int
-promread(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- struct tty *tp = prom_tty[minor(dev)];
-
- return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
-}
-
-int
-promwrite(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
-{
- struct tty *tp = prom_tty[minor(dev)];
-
- return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
-}
-
-int
-promioctl(dev, cmd, data, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
-{
- int unit = minor(dev);
- struct tty *tp = prom_tty[unit];
- int error;
-
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
- if (error >= 0)
- return error;
- error = ttioctl(tp, cmd, data, flag, p);
- if (error >= 0)
- return error;
-
- return ENOTTY;
-}
-
-int
-promparam(tp, t)
- struct tty *tp;
- struct termios *t;
-{
-
- return 0;
-}
-
-void
-promstart(tp)
- struct tty *tp;
-{
- int s;
-
- s = spltty();
- if (tp->t_state & (TS_TTSTOP | TS_BUSY))
- goto out;
- ttwakeupwr(tp);
- tp->t_state |= TS_BUSY;
- while (tp->t_outq.c_cc != 0)
- promcnputc(tp->t_dev, getc(&tp->t_outq));
- tp->t_state &= ~TS_BUSY;
-out:
- splx(s);
-}
-
-/*
- * Stop output on a line.
- */
-int
-promstop(tp, flag)
- struct tty *tp;
- int flag;
-{
- int s;
-
- s = spltty();
- if (tp->t_state & TS_BUSY)
- if ((tp->t_state & TS_TTSTOP) == 0)
- tp->t_state |= TS_FLUSH;
- splx(s);
- return 0;
-}
-
-void
-promtimeout(v)
- void *v;
-{
- struct tty *tp = v;
- u_char c;
-
- while (promcnlookc(tp->t_dev, &c)) {
- if (tp->t_state & TS_ISOPEN)
- (*linesw[tp->t_line].l_rint)(c, tp);
- }
- timeout_add(&prom_to, 1);
-}
-
-struct tty *
-promtty(dev)
- dev_t dev;
-{
-
- if (minor(dev) != 0)
- panic("promtty: bogus");
-
- return prom_tty[0];
-}
-# $OpenBSD: files.alpha,v 1.107 2018/02/14 23:51:49 jsg Exp $
+# $OpenBSD: files.alpha,v 1.108 2023/02/06 11:16:22 miod Exp $
# $NetBSD: files.alpha,v 1.32 1996/11/25 04:03:21 cgd Exp $
#
# alpha-specific configuration info
file arch/alpha/alpha/in_cksum.c
-# XXX
-file arch/alpha/alpha/promcons.c
-
# XXX
file arch/alpha/alpha/cpuconf.c
file arch/alpha/alpha/dec_2100_a50.c dec_2100_a50
-/* $OpenBSD: pmap.h,v 1.43 2023/01/31 15:18:54 deraadt Exp $ */
+/* $OpenBSD: pmap.h,v 1.44 2023/02/06 11:16:22 miod Exp $ */
/* $NetBSD: pmap.h,v 1.37 2000/11/19 03:16:35 thorpej Exp $ */
/*-
#define PG_PMAP_MOD PG_PMAP0 /* modified */
#define PG_PMAP_REF PG_PMAP1 /* referenced */
-#if defined(NEW_SCC_DRIVER)
-#if defined(DEC_KN8AE)
-#define _PMAP_MAY_USE_PROM_CONSOLE
-#endif
-#else /* ! NEW_SCC_DRIVER */
-#if defined(DEC_3000_300) \
- || defined(DEC_3000_500) \
- || defined(DEC_KN8AE) /* XXX */
-#define _PMAP_MAY_USE_PROM_CONSOLE /* XXX */
-#endif /* XXX */
-#endif /* NEW_SCC_DRIVER */
-
#if defined(MULTIPROCESSOR)
void pmap_tlb_shootdown(pmap_t, vaddr_t, pt_entry_t, u_long *);
void pmap_tlb_shootnow(u_long);
/* Machine-specific functions. */
void pmap_bootstrap(paddr_t ptaddr, u_int maxasn, u_long ncpuids);
int pmap_emulate_reference(struct proc *p, vaddr_t v, int user, int type);
-#ifdef _PMAP_MAY_USE_PROM_CONSOLE
-int pmap_uses_prom_console(void);
-#endif
#define pmap_pte_pa(pte) (PG_PFNUM(*(pte)) << PAGE_SHIFT)
#define pmap_pte_prot(pte) (*(pte) & PG_PROT)
-/* $OpenBSD: prom.h,v 1.11 2023/01/16 18:41:53 deraadt Exp $ */
+/* $OpenBSD: prom.h,v 1.12 2023/02/06 11:16:22 miod Exp $ */
/* $NetBSD: prom.h,v 1.12 2000/06/08 03:10:06 thorpej Exp $ */
/*
#if defined(_KERNEL) || defined(_STANDALONE)
void promcnputc(dev_t, int);
int promcngetc(dev_t);
-int promcnlookc(dev_t, char *);
u_int64_t prom_dispatch(u_int64_t, u_int64_t, u_int64_t, u_int64_t,
u_int64_t);