3b2: Fix line endings, enforce CONST
- Correct line endings on 3b2_ctc.c/.h and on 3b2_ports.c/.h. - Ensured CONST on const char* arrays.
This commit is contained in:
parent
392b8f26a4
commit
75b1a2f317
6 changed files with 2177 additions and 2177 deletions
1632
3B2/3b2_ctc.c
1632
3B2/3b2_ctc.c
File diff suppressed because it is too large
Load diff
316
3B2/3b2_ctc.h
316
3B2/3b2_ctc.h
|
@ -1,158 +1,158 @@
|
||||||
/* 3b2_ctc.h: AT&T 3B2 Model 400 "CTC" feature card
|
/* 3b2_ctc.h: AT&T 3B2 Model 400 "CTC" feature card
|
||||||
|
|
||||||
Copyright (c) 2018, Seth J. Morabito
|
Copyright (c) 2018, Seth J. Morabito
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person
|
Permission is hereby granted, free of charge, to any person
|
||||||
obtaining a copy of this software and associated documentation
|
obtaining a copy of this software and associated documentation
|
||||||
files (the "Software"), to deal in the Software without
|
files (the "Software"), to deal in the Software without
|
||||||
restriction, including without limitation the rights to use, copy,
|
restriction, including without limitation the rights to use, copy,
|
||||||
modify, merge, publish, distribute, sublicense, and/or sell copies
|
modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
of the Software, and to permit persons to whom the Software is
|
of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
The above copyright notice and this permission notice shall be
|
||||||
included in all copies or substantial portions of the Software.
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
Except as contained in this notice, the name of the author shall
|
Except as contained in this notice, the name of the author shall
|
||||||
not be used in advertising or otherwise to promote the sale, use or
|
not be used in advertising or otherwise to promote the sale, use or
|
||||||
other dealings in this Software without prior written authorization
|
other dealings in this Software without prior written authorization
|
||||||
from the author.
|
from the author.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CTC is an intelligent feature card for the 3B2 that supports a
|
* CTC is an intelligent feature card for the 3B2 that supports a
|
||||||
* Cipher "FloppyTape(tm)" 525 drive that can read and write 23MB
|
* Cipher "FloppyTape(tm)" 525 drive that can read and write 23MB
|
||||||
* DC600A cartridges.
|
* DC600A cartridges.
|
||||||
*
|
*
|
||||||
* The CTC card is based on the Common I/O (CIO) platform.
|
* The CTC card is based on the Common I/O (CIO) platform.
|
||||||
*
|
*
|
||||||
* Notes:
|
* Notes:
|
||||||
* ------
|
* ------
|
||||||
*
|
*
|
||||||
* The Cipher FloppyTape is an odd beast. Although it's a tape drive,
|
* The Cipher FloppyTape is an odd beast. Although it's a tape drive,
|
||||||
* it is controlled by a floppy controller. It is divided into virtual
|
* it is controlled by a floppy controller. It is divided into virtual
|
||||||
* sectors that can be addressed by Cylinder / Track / Sector.
|
* sectors that can be addressed by Cylinder / Track / Sector.
|
||||||
* Stepping and head select pulses dictate where on the tape to read
|
* Stepping and head select pulses dictate where on the tape to read
|
||||||
* from or write to. Moreover, System V maps a filesystem onto the
|
* from or write to. Moreover, System V maps a filesystem onto the
|
||||||
* tape, and a properly formatted tape drive will have a VTOC on
|
* tape, and a properly formatted tape drive will have a VTOC on
|
||||||
* partition 0.
|
* partition 0.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _3B2_CTC_H_
|
#ifndef _3B2_CTC_H_
|
||||||
#define _3B2_CTC_H_
|
#define _3B2_CTC_H_
|
||||||
|
|
||||||
#include "3b2_defs.h"
|
#include "3b2_defs.h"
|
||||||
#include "3b2_io.h"
|
#include "3b2_io.h"
|
||||||
|
|
||||||
#define UNIT_V_WLK (DKUF_V_UF + 0) /* Write-locked tape */
|
#define UNIT_V_WLK (DKUF_V_UF + 0) /* Write-locked tape */
|
||||||
#define UNIT_WLK (1 << UNIT_V_WLK)
|
#define UNIT_WLK (1 << UNIT_V_WLK)
|
||||||
|
|
||||||
#define CTC_ID 0x0005
|
#define CTC_ID 0x0005
|
||||||
#define CTC_IPL 12
|
#define CTC_IPL 12
|
||||||
#define CTC_VERSION 1
|
#define CTC_VERSION 1
|
||||||
|
|
||||||
/* Request Opcodes */
|
/* Request Opcodes */
|
||||||
#define CTC_CONFIG 30
|
#define CTC_CONFIG 30
|
||||||
#define CTC_CLOSE 31
|
#define CTC_CLOSE 31
|
||||||
#define CTC_FORMAT 32
|
#define CTC_FORMAT 32
|
||||||
#define CTC_OPEN 33
|
#define CTC_OPEN 33
|
||||||
#define CTC_READ 34
|
#define CTC_READ 34
|
||||||
#define CTC_WRITE 35
|
#define CTC_WRITE 35
|
||||||
#define CTC_VWRITE 36
|
#define CTC_VWRITE 36
|
||||||
|
|
||||||
/* Completion Opcodes */
|
/* Completion Opcodes */
|
||||||
#define CTC_SUCCESS 0
|
#define CTC_SUCCESS 0
|
||||||
#define CTC_HWERROR 32
|
#define CTC_HWERROR 32
|
||||||
#define CTC_RDONLY 33
|
#define CTC_RDONLY 33
|
||||||
#define CTC_NOTREADY 36
|
#define CTC_NOTREADY 36
|
||||||
#define CTC_NOMEDIA 42
|
#define CTC_NOMEDIA 42
|
||||||
|
|
||||||
/* VTOC values */
|
/* VTOC values */
|
||||||
#define VTOC_VERSION 1
|
#define VTOC_VERSION 1
|
||||||
#define VTOC_SECSZ 512
|
#define VTOC_SECSZ 512
|
||||||
#define VTOC_PART 16 /* Number of "partitions" on tape */
|
#define VTOC_PART 16 /* Number of "partitions" on tape */
|
||||||
#define VTOC_VALID 0x600DDEEE /* Magic number for valid VTOC */
|
#define VTOC_VALID 0x600DDEEE /* Magic number for valid VTOC */
|
||||||
|
|
||||||
/* Physical Device Info (pdinfo) values */
|
/* Physical Device Info (pdinfo) values */
|
||||||
#define PD_VALID 0xCA5E600D /* Magic number for valid PDINFO */
|
#define PD_VALID 0xCA5E600D /* Magic number for valid PDINFO */
|
||||||
#define PD_DRIVEID 5
|
#define PD_DRIVEID 5
|
||||||
#define PD_VERSION 0
|
#define PD_VERSION 0
|
||||||
#define PD_CYLS 6
|
#define PD_CYLS 6
|
||||||
#define PD_TRACKS 245
|
#define PD_TRACKS 245
|
||||||
#define PD_SECTORS 31
|
#define PD_SECTORS 31
|
||||||
#define PD_BYTES 512
|
#define PD_BYTES 512
|
||||||
#define PD_LOGICALST 29
|
#define PD_LOGICALST 29
|
||||||
|
|
||||||
#define CTC_CAPACITY (PD_CYLS * PD_TRACKS * PD_SECTORS) /* In blocks */
|
#define CTC_CAPACITY (PD_CYLS * PD_TRACKS * PD_SECTORS) /* In blocks */
|
||||||
|
|
||||||
struct partition {
|
struct partition {
|
||||||
uint16 id; /* Partition ID */
|
uint16 id; /* Partition ID */
|
||||||
uint16 flag; /* Permission Flags */
|
uint16 flag; /* Permission Flags */
|
||||||
uint32 sstart; /* Starting Sector */
|
uint32 sstart; /* Starting Sector */
|
||||||
uint32 ssize; /* Size in Sectors */
|
uint32 ssize; /* Size in Sectors */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vtoc {
|
struct vtoc {
|
||||||
uint32 bootinfo[3]; /* n/a */
|
uint32 bootinfo[3]; /* n/a */
|
||||||
uint32 sanity; /* magic number */
|
uint32 sanity; /* magic number */
|
||||||
uint32 version; /* layout version */
|
uint32 version; /* layout version */
|
||||||
uint8 volume[8]; /* volume name */
|
uint8 volume[8]; /* volume name */
|
||||||
uint16 sectorsz; /* sector size in bytes */
|
uint16 sectorsz; /* sector size in bytes */
|
||||||
uint16 nparts; /* number of partitions */
|
uint16 nparts; /* number of partitions */
|
||||||
uint32 reserved[10]; /* free space */
|
uint32 reserved[10]; /* free space */
|
||||||
struct partition part[VTOC_PART]; /* partition headers */
|
struct partition part[VTOC_PART]; /* partition headers */
|
||||||
uint32 timestamp[VTOC_PART]; /* partition timestamp */
|
uint32 timestamp[VTOC_PART]; /* partition timestamp */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pdinfo {
|
struct pdinfo {
|
||||||
uint32 driveid; /* identifies the device type */
|
uint32 driveid; /* identifies the device type */
|
||||||
uint32 sanity; /* verifies device sanity */
|
uint32 sanity; /* verifies device sanity */
|
||||||
uint32 version; /* version number */
|
uint32 version; /* version number */
|
||||||
uint8 serial[12]; /* serial number of the device */
|
uint8 serial[12]; /* serial number of the device */
|
||||||
uint32 cyls; /* number of cylinders per drive */
|
uint32 cyls; /* number of cylinders per drive */
|
||||||
uint32 tracks; /* number tracks per cylinder */
|
uint32 tracks; /* number tracks per cylinder */
|
||||||
uint32 sectors; /* number sectors per track */
|
uint32 sectors; /* number sectors per track */
|
||||||
uint32 bytes; /* number of bytes per sector */
|
uint32 bytes; /* number of bytes per sector */
|
||||||
uint32 logicalst; /* sector address of logical sector 0 */
|
uint32 logicalst; /* sector address of logical sector 0 */
|
||||||
uint32 errlogst; /* sector address of error log area */
|
uint32 errlogst; /* sector address of error log area */
|
||||||
uint32 errlogsz; /* size in bytes of error log area */
|
uint32 errlogsz; /* size in bytes of error log area */
|
||||||
uint32 mfgst; /* sector address of mfg. defect info */
|
uint32 mfgst; /* sector address of mfg. defect info */
|
||||||
uint32 mfgsz; /* size in bytes of mfg. defect info */
|
uint32 mfgsz; /* size in bytes of mfg. defect info */
|
||||||
uint32 defectst; /* sector address of the defect map */
|
uint32 defectst; /* sector address of the defect map */
|
||||||
uint32 defectsz; /* size in bytes of defect map */
|
uint32 defectsz; /* size in bytes of defect map */
|
||||||
uint32 relno; /* number of relocation areas */
|
uint32 relno; /* number of relocation areas */
|
||||||
uint32 relst; /* sector address of relocation area */
|
uint32 relst; /* sector address of relocation area */
|
||||||
uint32 relsz; /* size in sectors of relocation area */
|
uint32 relsz; /* size in sectors of relocation area */
|
||||||
uint32 relnext; /* address of next avail reloc sector */
|
uint32 relnext; /* address of next avail reloc sector */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32 time; /* Time used during a tape session (in 25ms chunks) */
|
uint32 time; /* Time used during a tape session (in 25ms chunks) */
|
||||||
} CTC_STATE;
|
} CTC_STATE;
|
||||||
|
|
||||||
extern DEVICE ctc_dev;
|
extern DEVICE ctc_dev;
|
||||||
|
|
||||||
t_stat ctc_reset(DEVICE *dptr);
|
t_stat ctc_reset(DEVICE *dptr);
|
||||||
t_stat ctc_svc(UNIT *uptr);
|
t_stat ctc_svc(UNIT *uptr);
|
||||||
t_stat ctc_attach(UNIT *uptr, CONST char *cptr);
|
t_stat ctc_attach(UNIT *uptr, CONST char *cptr);
|
||||||
t_stat ctc_detach(UNIT *uptr);
|
t_stat ctc_detach(UNIT *uptr);
|
||||||
void ctc_sysgen(uint8 cid);
|
void ctc_sysgen(uint8 cid);
|
||||||
void ctc_express(uint8 cid);
|
void ctc_express(uint8 cid);
|
||||||
void ctc_full(uint8 cid);
|
void ctc_full(uint8 cid);
|
||||||
|
|
||||||
/* Largely here for debugging purposes */
|
/* Largely here for debugging purposes */
|
||||||
static t_stat ctc_show_cqueue(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
static t_stat ctc_show_cqueue(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||||
static t_stat ctc_show_rqueue(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
static t_stat ctc_show_rqueue(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||||
static t_stat ctc_show_queue_common(FILE *st, UNIT *uptr, int32 val, CONST void *desc, t_bool rq);
|
static t_stat ctc_show_queue_common(FILE *st, UNIT *uptr, int32 val, CONST void *desc, t_bool rq);
|
||||||
|
|
||||||
#endif /* _3B2_CTC_H_ */
|
#endif /* _3B2_CTC_H_ */
|
||||||
|
|
|
@ -105,7 +105,7 @@ size_t id_buf_ptr = 0;
|
||||||
uint8 id_idfield[ID_IDFIELD_LEN];
|
uint8 id_idfield[ID_IDFIELD_LEN];
|
||||||
uint8 id_idfield_ptr = 0;
|
uint8 id_idfield_ptr = 0;
|
||||||
|
|
||||||
uint8 id_seek_state[ID_NUM_UNITS] = {ID_SEEK_NONE};
|
int8 id_seek_state[ID_NUM_UNITS] = {ID_SEEK_NONE};
|
||||||
|
|
||||||
struct id_dtype {
|
struct id_dtype {
|
||||||
uint8 hd; /* Number of heads */
|
uint8 hd; /* Number of heads */
|
||||||
|
|
|
@ -177,7 +177,7 @@ REG contty_reg[] = {
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
char *brg_rates[IU_SPEED_REGS][IU_SPEEDS] = {
|
CONST char *brg_rates[IU_SPEED_REGS][IU_SPEEDS] = {
|
||||||
{NULL, "110", NULL, NULL,
|
{NULL, "110", NULL, NULL,
|
||||||
"300", NULL, NULL, "1200",
|
"300", NULL, NULL, "1200",
|
||||||
"2400", "4800", NULL, "9600",
|
"2400", "4800", NULL, "9600",
|
||||||
|
@ -188,7 +188,7 @@ char *brg_rates[IU_SPEED_REGS][IU_SPEEDS] = {
|
||||||
"19200", NULL, NULL, NULL}
|
"19200", NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
char *parity[3] = {"O", "E", "N"};
|
CONST char *parity[3] = {"O", "E", "N"};
|
||||||
|
|
||||||
UNIT contty_unit[2] = {
|
UNIT contty_unit[2] = {
|
||||||
{ UDATA(&iu_svc_contty_rcv, UNIT_ATTABLE, 0) },
|
{ UDATA(&iu_svc_contty_rcv, UNIT_ATTABLE, 0) },
|
||||||
|
|
1926
3B2/3b2_ports.c
1926
3B2/3b2_ports.c
File diff suppressed because it is too large
Load diff
474
3B2/3b2_ports.h
474
3B2/3b2_ports.h
|
@ -1,237 +1,237 @@
|
||||||
/* 3b2_ports.h: AT&T 3B2 Model 400 "PORTS" feature card
|
/* 3b2_ports.h: AT&T 3B2 Model 400 "PORTS" feature card
|
||||||
|
|
||||||
Copyright (c) 2018, Seth J. Morabito
|
Copyright (c) 2018, Seth J. Morabito
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person
|
Permission is hereby granted, free of charge, to any person
|
||||||
obtaining a copy of this software and associated documentation
|
obtaining a copy of this software and associated documentation
|
||||||
files (the "Software"), to deal in the Software without
|
files (the "Software"), to deal in the Software without
|
||||||
restriction, including without limitation the rights to use, copy,
|
restriction, including without limitation the rights to use, copy,
|
||||||
modify, merge, publish, distribute, sublicense, and/or sell copies
|
modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
of the Software, and to permit persons to whom the Software is
|
of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
The above copyright notice and this permission notice shall be
|
||||||
included in all copies or substantial portions of the Software.
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
Except as contained in this notice, the name of the author shall
|
Except as contained in this notice, the name of the author shall
|
||||||
not be used in advertising or otherwise to promote the sale, use or
|
not be used in advertising or otherwise to promote the sale, use or
|
||||||
other dealings in this Software without prior written authorization
|
other dealings in this Software without prior written authorization
|
||||||
from the author.
|
from the author.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PORTS is an intelligent feature card for the 3B2 that supports four
|
* PORTS is an intelligent feature card for the 3B2 that supports four
|
||||||
* serial lines and one Centronics parallel port.
|
* serial lines and one Centronics parallel port.
|
||||||
*
|
*
|
||||||
* The PORTS card is based on the Common I/O (CIO) platform. It uses
|
* The PORTS card is based on the Common I/O (CIO) platform. It uses
|
||||||
* two SCN2681A DUARTs to supply the four serial lines, and uses the
|
* two SCN2681A DUARTs to supply the four serial lines, and uses the
|
||||||
* SCN2681A parallel I/O pins for the Centronics parallel port.
|
* SCN2681A parallel I/O pins for the Centronics parallel port.
|
||||||
*
|
*
|
||||||
* This file implements the required logic for the PORTS CIO
|
* This file implements the required logic for the PORTS CIO
|
||||||
* interface. The SCN2681A functionality is implemented in the file
|
* interface. The SCN2681A functionality is implemented in the file
|
||||||
* 3b2_duart.c, and is used by both this feature card and the System
|
* 3b2_duart.c, and is used by both this feature card and the System
|
||||||
* Board console/contty functionality.
|
* Board console/contty functionality.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _3B2_PORTS_H_
|
#ifndef _3B2_PORTS_H_
|
||||||
#define _3B2_PORTS_H_
|
#define _3B2_PORTS_H_
|
||||||
|
|
||||||
#include "3b2_defs.h"
|
#include "3b2_defs.h"
|
||||||
#include "3b2_io.h"
|
#include "3b2_io.h"
|
||||||
|
|
||||||
#define PORTS_ID 0x0003
|
#define PORTS_ID 0x0003
|
||||||
#define PORTS_IPL 10
|
#define PORTS_IPL 10
|
||||||
#define PORTS_VERSION 1
|
#define PORTS_VERSION 1
|
||||||
|
|
||||||
#define DEF_PORTS_CARDS 1
|
#define DEF_PORTS_CARDS 1
|
||||||
#define MAX_PORTS_CARDS 12
|
#define MAX_PORTS_CARDS 12
|
||||||
#define PORTS_LINES 4
|
#define PORTS_LINES 4
|
||||||
#define PORTS_RCV_QUEUE 5
|
#define PORTS_RCV_QUEUE 5
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sub-field values for the PPC_DEVICE request entry; these are placed
|
* Sub-field values for the PPC_DEVICE request entry; these are placed
|
||||||
* in app_data.bt[0] in the PPC_DEVICE application field. The prefix
|
* in app_data.bt[0] in the PPC_DEVICE application field. The prefix
|
||||||
* DR indicates that this is a code for use in "device" request
|
* DR indicates that this is a code for use in "device" request
|
||||||
* entries only.
|
* entries only.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DR_ENA 1 /* enable a device */
|
#define DR_ENA 1 /* enable a device */
|
||||||
#define DR_DIS 2 /* disable a device */
|
#define DR_DIS 2 /* disable a device */
|
||||||
#define DR_ABR 3 /* abort reception on a device */
|
#define DR_ABR 3 /* abort reception on a device */
|
||||||
#define DR_ABX 4 /* abort transmission on a device */
|
#define DR_ABX 4 /* abort transmission on a device */
|
||||||
#define DR_BRK 5 /* transmit "break" on a device */
|
#define DR_BRK 5 /* transmit "break" on a device */
|
||||||
#define DR_SUS 6 /* suspend xmit on a device */
|
#define DR_SUS 6 /* suspend xmit on a device */
|
||||||
#define DR_RES 7 /* resume xmit on a device */
|
#define DR_RES 7 /* resume xmit on a device */
|
||||||
#define DR_BLK 8 /* transmit STOP character */
|
#define DR_BLK 8 /* transmit STOP character */
|
||||||
#define DR_UNB 9 /* transmit START character */
|
#define DR_UNB 9 /* transmit START character */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sub-field values for the PPC_DEVICE completion entry; these appear
|
* Sub-field values for the PPC_DEVICE completion entry; these appear
|
||||||
* in app_data.bt[0] in the PPC_DEVICE application field. These are
|
* in app_data.bt[0] in the PPC_DEVICE application field. These are
|
||||||
* mutually exclusive and cannot be combined. The prefix DC indicates
|
* mutually exclusive and cannot be combined. The prefix DC indicates
|
||||||
* that this is a code for use in "device" completion entries only.
|
* that this is a code for use in "device" completion entries only.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DC_NORM 0x00 /* command executed as requested */
|
#define DC_NORM 0x00 /* command executed as requested */
|
||||||
#define DC_DEV 0x01 /* bad device number */
|
#define DC_DEV 0x01 /* bad device number */
|
||||||
#define DC_NON 0x02 /* bad sub-code on request */
|
#define DC_NON 0x02 /* bad sub-code on request */
|
||||||
#define DC_FAIL 0x03 /* failed to read express entry */
|
#define DC_FAIL 0x03 /* failed to read express entry */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sub-field values for the PPC_RECV completion entry; these appear in
|
* Sub-field values for the PPC_RECV completion entry; these appear in
|
||||||
* app_data.bt[0] in the PPC_RECV application field. These are NOT
|
* app_data.bt[0] in the PPC_RECV application field. These are NOT
|
||||||
* mutually exclusive and may appear in combination. The prefix RC
|
* mutually exclusive and may appear in combination. The prefix RC
|
||||||
* indicates that this is a code for use in "read" completion entries
|
* indicates that this is a code for use in "read" completion entries
|
||||||
* only.
|
* only.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define RC_DSR 0x01 /* disruption of service */
|
#define RC_DSR 0x01 /* disruption of service */
|
||||||
#define RC_FLU 0x02 /* buffer flushed */
|
#define RC_FLU 0x02 /* buffer flushed */
|
||||||
#define RC_TMR 0x04 /* inter-character timer expired */
|
#define RC_TMR 0x04 /* inter-character timer expired */
|
||||||
#define RC_BQO 0x08 /* PPC buffer queue overflow */
|
#define RC_BQO 0x08 /* PPC buffer queue overflow */
|
||||||
#define RC_UAO 0x10 /* uart overrun */
|
#define RC_UAO 0x10 /* uart overrun */
|
||||||
#define RC_PAR 0x20 /* parity error */
|
#define RC_PAR 0x20 /* parity error */
|
||||||
#define RC_FRA 0x40 /* framing error */
|
#define RC_FRA 0x40 /* framing error */
|
||||||
#define RC_BRK 0x80 /* break received */
|
#define RC_BRK 0x80 /* break received */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following codes are included on the DISC (disconnect) command.
|
* The following codes are included on the DISC (disconnect) command.
|
||||||
* They are "or"ed into the app_data.bt[1] application field in a
|
* They are "or"ed into the app_data.bt[1] application field in a
|
||||||
* request. These codes are NOT mutually exclusive and can be used in
|
* request. These codes are NOT mutually exclusive and can be used in
|
||||||
* any combination.
|
* any combination.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GR_DTR 0x01
|
#define GR_DTR 0x01
|
||||||
#define GR_CREAD 0x02
|
#define GR_CREAD 0x02
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sub-field values for the PPC_XMIT and PPC_OPTIONS completion
|
* Sub-field values for the PPC_XMIT and PPC_OPTIONS completion
|
||||||
* entries; these appear in app_data.bt[0] in the application fields.
|
* entries; these appear in app_data.bt[0] in the application fields.
|
||||||
* These are NOT mutually exclusive and may appear in combination.
|
* These are NOT mutually exclusive and may appear in combination.
|
||||||
* The prefix GC indicates that this is a code for use in "general"
|
* The prefix GC indicates that this is a code for use in "general"
|
||||||
* completion entries only.
|
* completion entries only.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GC_DSR 0x01 /* disruption of service */
|
#define GC_DSR 0x01 /* disruption of service */
|
||||||
#define GC_FLU 0x02 /* buffer flushed */
|
#define GC_FLU 0x02 /* buffer flushed */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sub-field values for the PPC_ASYNC completion entry; these appear
|
* Sub-field values for the PPC_ASYNC completion entry; these appear
|
||||||
* in app_data.bt[0] in the PPC_ASYNC application field. These are
|
* in app_data.bt[0] in the PPC_ASYNC application field. These are
|
||||||
* mutually exclusive and cannot be combined. The prefix AC indicates
|
* mutually exclusive and cannot be combined. The prefix AC indicates
|
||||||
* that this is a code for use in "asynchronous" completion entries
|
* that this is a code for use in "asynchronous" completion entries
|
||||||
* only.
|
* only.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define AC_CON 0x01 /* connection detected */
|
#define AC_CON 0x01 /* connection detected */
|
||||||
#define AC_DIS 0x02 /* disconnection detected */
|
#define AC_DIS 0x02 /* disconnection detected */
|
||||||
#define AC_BRK 0x03 /* asynchronous "break" */
|
#define AC_BRK 0x03 /* asynchronous "break" */
|
||||||
#define AC_FLU 0x04 /* xmit flush complete */
|
#define AC_FLU 0x04 /* xmit flush complete */
|
||||||
|
|
||||||
/* Line Discipline flags (input and output) */
|
/* Line Discipline flags (input and output) */
|
||||||
|
|
||||||
#define IGNBRK 0x0001
|
#define IGNBRK 0x0001
|
||||||
#define BRKINT 0x0002
|
#define BRKINT 0x0002
|
||||||
#define IGNPAR 0x0004
|
#define IGNPAR 0x0004
|
||||||
#define PARMRK 0x0008
|
#define PARMRK 0x0008
|
||||||
#define INPCK 0x0010
|
#define INPCK 0x0010
|
||||||
#define ISTRIP 0x0020
|
#define ISTRIP 0x0020
|
||||||
#define INLCR 0x0040
|
#define INLCR 0x0040
|
||||||
#define IGNCR 0x0080
|
#define IGNCR 0x0080
|
||||||
#define ICRNL 0x0100
|
#define ICRNL 0x0100
|
||||||
#define IUCLC 0x0200
|
#define IUCLC 0x0200
|
||||||
#define IXON 0x0400
|
#define IXON 0x0400
|
||||||
#define IXANY 0x0800
|
#define IXANY 0x0800
|
||||||
|
|
||||||
#define OPOST 0x0001
|
#define OPOST 0x0001
|
||||||
#define OLCUC 0x0002
|
#define OLCUC 0x0002
|
||||||
#define ONLCR 0x0004
|
#define ONLCR 0x0004
|
||||||
#define OCRNL 0x0008
|
#define OCRNL 0x0008
|
||||||
#define ONOCR 0x0010
|
#define ONOCR 0x0010
|
||||||
#define ONLRET 0x0020
|
#define ONLRET 0x0020
|
||||||
#define OFILL 0x0040
|
#define OFILL 0x0040
|
||||||
#define OFDEL 0x0080
|
#define OFDEL 0x0080
|
||||||
#define ONLDLY 0x0100
|
#define ONLDLY 0x0100
|
||||||
#define OCRDLY 0x0600
|
#define OCRDLY 0x0600
|
||||||
#define OTABDLY 0x1800
|
#define OTABDLY 0x1800
|
||||||
#define OBSDLY 0x2000
|
#define OBSDLY 0x2000
|
||||||
#define OVTDLY 0x4000
|
#define OVTDLY 0x4000
|
||||||
#define OFFDLY 0x8000
|
#define OFFDLY 0x8000
|
||||||
|
|
||||||
/* Opcodes for PORTS card */
|
/* Opcodes for PORTS card */
|
||||||
|
|
||||||
#define PPC_OPTIONS 32 /* GEN, COMP queues: set PPC options */
|
#define PPC_OPTIONS 32 /* GEN, COMP queues: set PPC options */
|
||||||
#define PPC_XMIT 33 /* GEN, COMP queues: transmit a buffer */
|
#define PPC_XMIT 33 /* GEN, COMP queues: transmit a buffer */
|
||||||
#define PPC_CONN 34 /* GEN, COMP queues: connect a device */
|
#define PPC_CONN 34 /* GEN, COMP queues: connect a device */
|
||||||
#define PPC_DISC 35 /* GEN, COMP queues: disconnect a device */
|
#define PPC_DISC 35 /* GEN, COMP queues: disconnect a device */
|
||||||
#define PPC_BRK 36 /* GEN, COMP queues: ioctl break */
|
#define PPC_BRK 36 /* GEN, COMP queues: ioctl break */
|
||||||
#define PPC_DEVICE 40 /* EXP, ECOMP entries: device control command */
|
#define PPC_DEVICE 40 /* EXP, ECOMP entries: device control command */
|
||||||
#define PPC_CLR 41 /* EXP, ECOMP entries: board clear */
|
#define PPC_CLR 41 /* EXP, ECOMP entries: board clear */
|
||||||
#define PPC_RECV 50 /* RECV, COMP queues: receive request */
|
#define PPC_RECV 50 /* RECV, COMP queues: receive request */
|
||||||
#define PPC_ASYNC 60 /* Asynchronous request */
|
#define PPC_ASYNC 60 /* Asynchronous request */
|
||||||
#define CFW_CONFIG 70 /* GEN, COMP queues: set PPC port 0 hardware options */
|
#define CFW_CONFIG 70 /* GEN, COMP queues: set PPC port 0 hardware options */
|
||||||
#define CFW_IREAD 71 /* GEN, COMP queues: read immediate one to four bytes */
|
#define CFW_IREAD 71 /* GEN, COMP queues: read immediate one to four bytes */
|
||||||
#define CFW_IWRITE 72 /* GEN, COMP queues: write immediate one to four bytes */
|
#define CFW_IWRITE 72 /* GEN, COMP queues: write immediate one to four bytes */
|
||||||
#define CFW_WRITE 73 /* GEN, COMP queues: write */
|
#define CFW_WRITE 73 /* GEN, COMP queues: write */
|
||||||
#define PPC_VERS 80 /* EXP, COMP queues: Version */
|
#define PPC_VERS 80 /* EXP, COMP queues: Version */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32 tx_addr; /* Address to next read from */
|
uint32 tx_addr; /* Address to next read from */
|
||||||
uint32 tx_req_addr; /* Original request address */
|
uint32 tx_req_addr; /* Original request address */
|
||||||
uint32 tx_chars; /* Number of chars left to transfer */
|
uint32 tx_chars; /* Number of chars left to transfer */
|
||||||
uint32 tx_req_chars; /* Original number of chars */
|
uint32 tx_req_chars; /* Original number of chars */
|
||||||
uint8 rlp; /* Last known load pointer */
|
uint8 rlp; /* Last known load pointer */
|
||||||
uint16 iflag; /* Line Discipline: Input flags */
|
uint16 iflag; /* Line Discipline: Input flags */
|
||||||
uint16 oflag; /* Line Discipline: Output flags */
|
uint16 oflag; /* Line Discipline: Output flags */
|
||||||
t_bool crlf; /* Indicates we are in a CRLF output transform */
|
t_bool crlf; /* Indicates we are in a CRLF output transform */
|
||||||
t_bool conn; /* TRUE if connected, FALSE otherwise */
|
t_bool conn; /* TRUE if connected, FALSE otherwise */
|
||||||
} PORTS_LINE_STATE;
|
} PORTS_LINE_STATE;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint16 line; /* line discipline */
|
uint16 line; /* line discipline */
|
||||||
uint16 pad1;
|
uint16 pad1;
|
||||||
uint16 iflag; /* input options word */
|
uint16 iflag; /* input options word */
|
||||||
uint16 oflag; /* output options word */
|
uint16 oflag; /* output options word */
|
||||||
uint16 cflag; /* hardware options */
|
uint16 cflag; /* hardware options */
|
||||||
uint16 lflag; /* line discipline options */
|
uint16 lflag; /* line discipline options */
|
||||||
uint8 cerase; /* "erase" character */
|
uint8 cerase; /* "erase" character */
|
||||||
uint8 ckill; /* "kill" character */
|
uint8 ckill; /* "kill" character */
|
||||||
uint8 cinter; /* "interrupt" character */
|
uint8 cinter; /* "interrupt" character */
|
||||||
uint8 cquit; /* "quit" character */
|
uint8 cquit; /* "quit" character */
|
||||||
uint8 ceof; /* "end of file" character */
|
uint8 ceof; /* "end of file" character */
|
||||||
uint8 ceol; /* "end of line" character */
|
uint8 ceol; /* "end of line" character */
|
||||||
uint8 itime; /* inter character timer multiplier */
|
uint8 itime; /* inter character timer multiplier */
|
||||||
uint8 vtime; /* user-specified inter char timer */
|
uint8 vtime; /* user-specified inter char timer */
|
||||||
uint8 vcount; /* user-specified maximum buffer char count */
|
uint8 vcount; /* user-specified maximum buffer char count */
|
||||||
uint8 pad2;
|
uint8 pad2;
|
||||||
uint16 pad3;
|
uint16 pad3;
|
||||||
} PORTS_OPTIONS;
|
} PORTS_OPTIONS;
|
||||||
|
|
||||||
extern DEVICE ports_dev;
|
extern DEVICE ports_dev;
|
||||||
|
|
||||||
t_stat ports_reset(DEVICE *dptr);
|
t_stat ports_reset(DEVICE *dptr);
|
||||||
t_stat ports_setnl(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
t_stat ports_setnl(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||||
t_stat ports_show_cqueue(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
t_stat ports_show_cqueue(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||||
t_stat ports_show_rqueue(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
t_stat ports_show_rqueue(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||||
t_stat ports_rcv_svc(UNIT *uptr);
|
t_stat ports_rcv_svc(UNIT *uptr);
|
||||||
t_stat ports_xmt_svc(UNIT *uptr);
|
t_stat ports_xmt_svc(UNIT *uptr);
|
||||||
t_stat ports_cio_svc(UNIT *uptr);
|
t_stat ports_cio_svc(UNIT *uptr);
|
||||||
t_stat ports_attach(UNIT *uptr, CONST char *cptr);
|
t_stat ports_attach(UNIT *uptr, CONST char *cptr);
|
||||||
t_stat ports_detach(UNIT *uptr);
|
t_stat ports_detach(UNIT *uptr);
|
||||||
void ports_sysgen(uint8 cid);
|
void ports_sysgen(uint8 cid);
|
||||||
void ports_express(uint8 cid);
|
void ports_express(uint8 cid);
|
||||||
void ports_full(uint8 cid);
|
void ports_full(uint8 cid);
|
||||||
|
|
||||||
static t_stat ports_show_queue_common(FILE *st, UNIT *uptr, int32 val,
|
static t_stat ports_show_queue_common(FILE *st, UNIT *uptr, int32 val,
|
||||||
CONST void *desc, t_bool rq);
|
CONST void *desc, t_bool rq);
|
||||||
|
|
||||||
#endif /* _3B2_PORTS_H_ */
|
#endif /* _3B2_PORTS_H_ */
|
||||||
|
|
Loading…
Add table
Reference in a new issue