From 12f7f0563e109a9981ad4cb41bfd3e227e4fe036 Mon Sep 17 00:00:00 2001 From: marcel Date: Sat, 18 Aug 2012 22:59:06 +0000 Subject: Remove support for SKI: HP's Itanium simulator. It's pretty much not used, serves very little value given that FreeBSD runs on real H/W for a long time. Note that SKI is open-source (see http://ski.sourceforge.net), so if there's interest and value again, then this code can be revived. Discussed with: jhb --- sys/conf/files.ia64 | 2 - sys/conf/options.ia64 | 5 -- sys/ia64/conf/NOTES | 4 - sys/ia64/conf/SKI | 61 --------------- sys/ia64/ia64/ssc.c | 192 --------------------------------------------- sys/ia64/ia64/sscdisk.c | 203 ------------------------------------------------ 6 files changed, 467 deletions(-) delete mode 100644 sys/ia64/conf/SKI delete mode 100644 sys/ia64/ia64/ssc.c delete mode 100644 sys/ia64/ia64/sscdisk.c (limited to 'sys') diff --git a/sys/conf/files.ia64 b/sys/conf/files.ia64 index 42fb98d..7bedb08 100644 --- a/sys/conf/files.ia64 +++ b/sys/conf/files.ia64 @@ -104,8 +104,6 @@ ia64/ia64/ptrace_machdep.c standard ia64/ia64/sal.c standard ia64/ia64/sapic.c standard ia64/ia64/setjmp.S standard -ia64/ia64/ssc.c optional ski -ia64/ia64/sscdisk.c optional ski ia64/ia64/stack_machdep.c optional ddb | stack ia64/ia64/support.S standard ia64/ia64/sys_machdep.c standard diff --git a/sys/conf/options.ia64 b/sys/conf/options.ia64 index 603c5ed..6eefc8c 100644 --- a/sys/conf/options.ia64 +++ b/sys/conf/options.ia64 @@ -29,8 +29,3 @@ PSM_DEBUG opt_psm.h # Atkbd options ATKBD_DFLT_KEYMAP opt_atkbd.h - -# SKI emulator options -SKI opt_ski.h -SKI_ROOT_FILESYSTEM opt_ski.h -SSC_NSECT opt_ski.h diff --git a/sys/ia64/conf/NOTES b/sys/ia64/conf/NOTES index 0f8a4e7..107c70f 100644 --- a/sys/ia64/conf/NOTES +++ b/sys/ia64/conf/NOTES @@ -27,10 +27,6 @@ options LOG2_ID_PAGE_SIZE=27 # 128M # The page size being equal to 1< -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define SSC_GETCHAR 21 -#define SSC_PUTCHAR 31 - -#define SSC_POLL_HZ 50 - -static tsw_open_t ssc_open; -static tsw_outwakeup_t ssc_outwakeup; -static tsw_close_t ssc_close; - -static struct ttydevsw ssc_class = { - .tsw_flags = TF_NOPREFIX, - .tsw_open = ssc_open, - .tsw_outwakeup = ssc_outwakeup, - .tsw_close = ssc_close, -}; - -static int polltime; -static struct callout_handle ssc_timeouthandle - = CALLOUT_HANDLE_INITIALIZER(&ssc_timeouthandle); - -static void ssc_timeout(void *); - -static u_int64_t -ssc(u_int64_t in0, u_int64_t in1, u_int64_t in2, u_int64_t in3, int which) -{ - register u_int64_t ret0 __asm("r8"); - - __asm __volatile("mov r15=%1\n\t" - "break 0x80001" - : "=r"(ret0) - : "r"(which), "r"(in0), "r"(in1), "r"(in2), "r"(in3)); - return ret0; -} - -static void -ssc_cnprobe(struct consdev *cp) -{ - - strcpy(cp->cn_name, "ssccons"); - cp->cn_pri = CN_INTERNAL; -} - -static void -ssc_cninit(struct consdev *cp) -{ -} - -static void -ssc_cnterm(struct consdev *cp) -{ -} - -static void -ssc_cngrab(struct consdev *cp) -{ -} - -static void -ssc_cnungrab(struct consdev *cp) -{ -} - -static void -ssc_cnattach(void *arg) -{ - struct tty *tp; - - tp = tty_alloc(&ssc_class, NULL); - tty_makedev(tp, NULL, "ssccons"); -} - -SYSINIT(ssc_cnattach, SI_SUB_DRIVERS, SI_ORDER_ANY, ssc_cnattach, 0); - -static void -ssc_cnputc(struct consdev *cp, int c) -{ - ssc(c, 0, 0, 0, SSC_PUTCHAR); -} - -static int -ssc_cngetc(struct consdev *cp) -{ - int c; - c = ssc(0, 0, 0, 0, SSC_GETCHAR); - if (!c) - return -1; - return c; -} - -static int -ssc_open(struct tty *tp) -{ - - polltime = hz / SSC_POLL_HZ; - if (polltime < 1) - polltime = 1; - ssc_timeouthandle = timeout(ssc_timeout, tp, polltime); - - return (0); -} - -static void -ssc_close(struct tty *tp) -{ - - untimeout(ssc_timeout, tp, ssc_timeouthandle); -} - -static void -ssc_outwakeup(struct tty *tp) -{ - char buf[128]; - size_t len, c; - - for (;;) { - len = ttydisc_getc(tp, buf, sizeof buf); - if (len == 0) - break; - - c = 0; - while (len-- > 0) - ssc_cnputc(NULL, buf[c++]); - } -} - -static void -ssc_timeout(void *v) -{ - struct tty *tp = v; - int c; - - tty_lock(tp); - while ((c = ssc_cngetc(NULL)) != -1) - ttydisc_rint(tp, c, 0); - ttydisc_rint_done(tp); - tty_unlock(tp); - - ssc_timeouthandle = timeout(ssc_timeout, tp, polltime); -} - -CONSOLE_DRIVER(ssc); diff --git a/sys/ia64/ia64/sscdisk.c b/sys/ia64/ia64/sscdisk.c deleted file mode 100644 index 146be7f..0000000 --- a/sys/ia64/ia64/sscdisk.c +++ /dev/null @@ -1,203 +0,0 @@ -/*- - * ---------------------------------------------------------------------------- - * "THE BEER-WARE LICENSE" (Revision 42): - * wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you think - * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - * ---------------------------------------------------------------------------- - * - * $FreeBSD$ - * - */ - -#include "opt_md.h" -#include "opt_ski.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef SKI_ROOT_FILESYSTEM -#define SKI_ROOT_FILESYSTEM "ia64-root.fs" -#endif - -#define SSC_OPEN 50 -#define SSC_CLOSE 51 -#define SSC_READ 52 -#define SSC_WRITE 53 -#define SSC_GET_COMPLETION 54 -#define SSC_WAIT_COMPLETION 55 - -struct disk_req { - unsigned long addr; - unsigned len; -}; - -struct disk_stat { - int fd; - unsigned count; -}; - -static u_int64_t -ssc(u_int64_t in0, u_int64_t in1, u_int64_t in2, u_int64_t in3, int which) -{ - register u_int64_t ret0 __asm("r8"); - - __asm __volatile("mov r15=%1\n\t" - "break 0x80001" - : "=r"(ret0) - : "r"(which), "r"(in0), "r"(in1), "r"(in2), "r"(in3)); - return ret0; -} - -#ifndef SSC_NSECT -#define SSC_NSECT 409600 -#endif - -static MALLOC_DEFINE(M_SSC, "ssc_disk", "Simulator Disk"); - -static d_strategy_t sscstrategy; - -static LIST_HEAD(, ssc_s) ssc_softc_list = LIST_HEAD_INITIALIZER(ssc_softc_list); -static struct mtx ssc_list_lock; -MTX_SYSINIT(ssc_list, &ssc_list_lock, "ssc list", MTX_DEF); - -struct ssc_s { - int unit; - LIST_ENTRY(ssc_s) list; - struct bio_queue_head bio_queue; - struct disk *disk; - struct mtx lock; - int busy; - int fd; -}; - -static int sscunits; - -static void -sscstrategy(struct bio *bp) -{ - struct ssc_s *sc; - struct disk_req req; - struct disk_stat stat; - u_long len, va, off; - - sc = bp->bio_disk->d_drv1; - - mtx_lock(&sc->lock); - bioq_disksort(&sc->bio_queue, bp); - - if (sc->busy) { - mtx_unlock(&sc->lock); - return; - } - sc->busy++; - - for (;;) { - bp = bioq_takefirst(&sc->bio_queue); - if (!bp) - break; - - mtx_unlock(&sc->lock); - va = (u_long) bp->bio_data; - len = bp->bio_bcount; - off = bp->bio_pblkno << DEV_BSHIFT; - while (len > 0) { - u_int t; - if ((va & PAGE_MASK) + len > PAGE_SIZE) - t = PAGE_SIZE - (va & PAGE_MASK); - else - t = len; - req.len = t; - req.addr = ia64_tpa(va); - ssc(sc->fd, 1, ia64_tpa((long) &req), off, - (bp->bio_cmd == BIO_READ) ? SSC_READ : SSC_WRITE); - stat.fd = sc->fd; - ssc(ia64_tpa((long)&stat), 0, 0, 0, - SSC_WAIT_COMPLETION); - va += t; - len -= t; - off += t; - } - bp->bio_resid = 0; - biodone(bp); - mtx_lock(&sc->lock); - } - - sc->busy = 0; - mtx_unlock(&sc->lock); - return; -} - -static struct ssc_s * -ssccreate(int unit) -{ - struct ssc_s *sc; - int fd; - - fd = ssc(ia64_tpa((u_int64_t) SKI_ROOT_FILESYSTEM), - 1, 0, 0, SSC_OPEN); - if (fd == -1) - return (NULL); - - sc = malloc(sizeof(*sc), M_SSC, M_WAITOK | M_ZERO); - - mtx_lock(&ssc_list_lock); - if (unit == -1) - unit = sscunits++; - /* Make sure this unit isn't already in action */ - LIST_FOREACH(sc, &ssc_softc_list, list) { - if (sc->unit == unit) { - mtx_unlock(&ssc_list_lock); - free(sc, M_SSC); - return (NULL); - } - } - LIST_INSERT_HEAD(&ssc_softc_list, sc, list); - sc->unit = unit; - mtx_unlock(&ssc_list_lock); - bioq_init(&sc->bio_queue); - mtx_init(&sc->lock, "ssc", NULL, MTX_DEF); - - sc->disk = disk_alloc(); - sc->disk->d_drv1 = sc; - sc->disk->d_fwheads = 0; - sc->disk->d_fwsectors = 0; - sc->disk->d_maxsize = DFLTPHYS; - sc->disk->d_mediasize = (off_t)SSC_NSECT * DEV_BSIZE; - sc->disk->d_name = "sscdisk"; - sc->disk->d_sectorsize = DEV_BSIZE; - sc->disk->d_strategy = sscstrategy; - sc->disk->d_unit = sc->unit; - disk_create(sc->disk, DISK_VERSION); - sc->fd = fd; - if (sc->unit == 0) - rootdevnames[0] = "ufs:/dev/sscdisk0"; - return (sc); -} - -static void -ssc_drvinit(void *unused) -{ - ssccreate(-1); -} - -SYSINIT(sscdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE, ssc_drvinit,NULL); -- cgit v1.1