|
|
1.1 ! root 1: /* (-lgl ! 2: * COHERENT Version 4.0 ! 3: * Copyright (c) 1982, 1992 by Mark Williams Company. ! 4: * All rights reserved. May not be copied without permission. ! 5: -lgl) */ ! 6: /* ! 7: * Buffer header. ! 8: */ ! 9: #ifndef BUF_H ! 10: #define BUF_H ! 11: ! 12: #include <sys/types.h> ! 13: ! 14: typedef struct buf { ! 15: struct buf *b_actf; /* First in queue */ ! 16: struct buf *b_actl; /* Last in queue */ ! 17: GATE b_gate; /* Gate */ ! 18: unsigned b_flag; /* Flags */ ! 19: dev_t b_dev; /* Device */ ! 20: daddr_t b_bno; /* Block number */ ! 21: char b_req; /* I/O type */ ! 22: char b_err; /* Error */ ! 23: unsigned b_seqn; /* Buffer sequence number */ ! 24: bold_t b_map; /* Old map */ ! 25: #ifndef _I386 ! 26: vaddr_t b_count; /* Size of I/O */ ! 27: vaddr_t b_resid; /* Driver returns count here */ ! 28: faddr_t b_faddr; /* Far Virtual address */ ! 29: paddr_t b_paddr; /* Physical address */ ! 30: #else ! 31: off_t b_count; /* Size of I/O */ ! 32: off_t b_resid; /* Driver returns count here */ ! 33: paddr_t b_paddr; /* physical address (bytes) */ ! 34: vaddr_t b_vaddr; /* kernel virtual address (bytes) */ ! 35: unsigned long b_hashval; /* used to index into hasharray[] */ ! 36: struct buf *b_LRUf; /* Next (older) in LRU chain */ ! 37: struct buf *b_LRUb; /* Previous (newer) in LRU chain */ ! 38: struct buf *b_hashf; /* Next in this hash chain */ ! 39: struct buf *b_hashb; /* Previous in this hash chain */ ! 40: #endif /* _I386 */ ! 41: } BUF; ! 42: ! 43: /* ! 44: * Flags (b_flags). ! 45: */ ! 46: #define BFNTP 0x0001 /* Buffer not valid */ ! 47: #define BFREQ 0x0002 /* Buffer requested */ ! 48: #define BFERR 0x0004 /* Error */ ! 49: #define BFMOD 0x0008 /* Data has been modified */ ! 50: #define BFASY 0x0010 /* Asynchrous */ ! 51: #define BFMAP 0x0020 /* Buffer has been mapped */ ! 52: #define BFRAW 0x0040 /* Request is raw */ ! 53: #define BFTAP 0x0080 /* Request is to a tape */ ! 54: ! 55: #define BFBLK 0x4000 /* Aligned on a block boundary */ ! 56: #define BFIOC 0x8000 /* Perform bounds checking */ ! 57: ! 58: /* ! 59: * Requests. ! 60: */ ! 61: #define BREAD 1 /* Read */ ! 62: #define BWRITE 2 /* Write */ ! 63: /* sad but true, floppy driver uses these: */ ! 64: #define BFLSTAT 3 /* Floppy Drive Status */ ! 65: #define BFLFMT 4 /* Floppy Disk Format */ ! 66: ! 67: #define BNULL ((BUF *)0) ! 68: ! 69: #ifdef KERNEL ! 70: /* ! 71: * Functions. ! 72: */ ! 73: extern BUF *bread(); /* bio.c */ ! 74: extern BUF *bclaim(); /* bio.c */ ! 75: extern BUF *vread(); /* fs3.c */ ! 76: extern BUF *aread(); /* fs3.c */ ! 77: extern daddr_t vmap(); /* fs3.c */ ! 78: extern int *lmap(); /* fs3.c */ ! 79: ! 80: /* ! 81: * Global variables. ! 82: */ ! 83: extern unsigned bufseqn; /* Buffer sequencer */ ! 84: extern int bufneed; /* Buffer is needed */ ! 85: extern BUF swapbuf; /* Buffer for swap I/O */ ! 86: extern BUF *bufl; /* Buffer headers */ ! 87: #endif /* KERNEL */ ! 88: ! 89: #endif /* BUF_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.