File: disk.h

package info (click to toggle)
syslinux 3%3A6.03%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 41,220 kB
  • sloc: ansic: 358,747; asm: 9,606; pascal: 4,809; perl: 3,894; makefile: 2,488; sh: 324; python: 266; xml: 39
file content (43 lines) | stat: -rw-r--r-- 1,074 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef DISK_H
#define DISK_H

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <core.h>

typedef uint64_t sector_t;
typedef uint64_t block_t;

struct bios_disk_private {
	com32sys_t *regs;
};

/*
 * struct disk: contains the information about a specific disk and also
 * contains the I/O function.
 */
struct disk {
    void *private;	/* Firmware-private disk info */
    unsigned int disk_number;	/* in BIOS style */
    unsigned int sector_size;	/* gener512B or 2048B */
    unsigned int sector_shift;
    unsigned int maxtransfer;	/* Max sectors per transfer */
    
    unsigned int h, s;		/* CHS geometry */
    unsigned int secpercyl;	/* h*s */
    unsigned int _pad;

    sector_t part_start;   /* the start address of this partition(in sectors) */

    int (*rdwr_sectors)(struct disk *, void *, sector_t, size_t, bool);
};

extern void read_sectors(char *, sector_t, int);
extern void getoneblk(struct disk *, char *, block_t, int);

/* diskio.c */
struct disk *bios_disk_init(void *);
struct device *device_init(void *);

#endif /* DISK_H */