Changeset 99cac86 in buchla-68k


Ignore:
Timestamp:
07/16/2017 11:27:12 AM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
d60f436
Parents:
ea232f9
Message:

Simplify kind handling.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • include/io.h

    rea232f9 r99cac86  
    3434        int16_t d_seek;         /* seek routine code */
    3535        devop   d_open;         /* special open function */
     36        int16_t d_kind;         /* kind of device */
    3637};
    3738
     
    4041        int8_t  *d_name;        /* device name */
    4142        struct  device  *d_dev; /* pointer to device structure */
    42         io_arg  d_arg;          /* argument to device driver */
    43         int16_t d_kind;         /* kind of device */
    4443};
  • libcio/clusmap.c

    rea232f9 r99cac86  
    258258        chclo arg;
    259259        int16_t ft;
    260         int8_t  *ds, *fsn, *fse;
     260        int8_t  *fsn, *fse;
    261261        struct  fcb     *fcp;
    262262
     
    275275        if (arg EQ _nopc) {
    276276
    277                 ds = ((struct devtabl *)chantab[fp->_unit].c_arg)->d_name;
    278                 printf(" is a device:  [%s]\n", ds);
     277                printf(" has device kind:  [%d]\n",
     278                        (int16_t)(int32_t)chantab[fp->_unit].c_arg);
    279279
    280280        } else if (arg EQ _filecl) {
  • libcio/conwr.c

    rea232f9 r99cac86  
    1818int16_t _conwr(io_arg arg, void *buff, int16_t len)
    1919{
    20         struct devtabl *dp;
     20        int16_t kind;
    2121        int8_t *buff8;
    2222        register int16_t count;
    2323
    24         dp = (struct devtabl *)arg;
     24        kind = (int16_t)arg;
    2525        buff8 = buff;
    2626
    2727        for (count = 0; count < len; ++count)
    28                 BIOS(B_PUTC, dp->d_kind, *buff8++);
     28                BIOS(B_PUTC, kind, *buff8++);
    2929
    3030        return(count);
  • libcio/fsinit.c

    rea232f9 r99cac86  
    157157
    158158        for (i = 3; i < MAXCHAN; i++)   /*  3..MAXCHAN-1 - not preassigned */
    159                 InitCH(&chantab[i], 0, 0, 0, 0, _badfc, (io_arg)0L );
     159                InitCH(&chantab[i], 0, 0, 0, 0, _badfc, (io_arg)-1 );
    160160
    161161        _bpbin  = FALSE;        /* BPB isn't in memory */
  • libcio/open.c

    rea232f9 r99cac86  
    88#include "ram.h"
    99
    10 static struct device condev  = { 2, 2, 1, 0, _nopo  };
    11 static struct device filedev = { 1, 1, 0, 1, _fileop };
     10static struct device condev  = { 2, 2, 1, 0, _nopo,   CON_DEV };
     11static struct device filedev = { 1, 1, 0, 1, _fileop,      -1 };
    1212
    1313/*
     
    1919static struct devtabl devtabl[] = {
    2020
    21         { "con:", &condev,  &devtabl[0], CON_DEV },     /* console device */
    22         { "CON:", &condev,  &devtabl[1], CON_DEV },
    23 
    24         {      0, &filedev,        NULL,      -1 }      /* this MUST be the last entry */
     21        { "con:", &condev  },   /* console device */
     22        { "CON:", &condev  },
     23
     24        {      0, &filedev }    /* this MUST be the last entry */
    2525};
    2626
     
    8080        /* setup the channel table entries */
    8181
    82         chp->c_arg   = dp->d_arg;
     82        chp->c_arg   = (io_arg)(int32_t)dp->d_dev->d_kind;
    8383        chp->c_ioctl = dev->d_ioctl;
    8484        chp->c_seek  = dev->d_seek;
Note: See TracChangeset for help on using the changeset viewer.