VirtualBox

source: vbox/trunk/src/VBox/Devices/PC/Etherboot-src/include/disk.h@ 2564

最後變更 在這個檔案從2564是 1,由 vboxsync 提交於 55 年 前

import

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 1.5 KB
 
1#ifndef DISK_H
2#define DISK_H
3
4#include "dev.h"
5
6/*
7 * Structure returned from disk_probe and passed to other driver
8 * functions.
9 */
10struct disk
11{
12 struct dev dev; /* This must come first */
13 int (*read)(struct disk *, sector_t sector);
14 unsigned int drive;
15 unsigned long hw_sector_size; /* The hardware sector size for dealing
16 * with partition tables and the like.
17 * Must be >= 512
18 */
19 unsigned int sectors_per_read; /* The number of 512 byte sectors
20 * returned by each read call.
21 * All I/O must be aligned to this size.
22 */
23 unsigned int bytes; /* The number of bytes in the read buffer. */
24 sector_t sectors; /* The number of sectors on the drive. */
25 sector_t sector; /* The first sector in the driver buffer */
26 unsigned char *buffer; /* The data read from the drive */
27 void *priv; /* driver can hang private data here */
28
29 unsigned long disk_offset;
30 int direction;
31};
32
33extern struct disk disk;
34extern int url_file(const char *name,
35 int (*fnc)(unsigned char *, unsigned int, unsigned int, int));
36
37extern int disk_probe(struct dev *dev);
38extern int disk_load_configuration(struct dev *dev);
39extern int disk_load(struct dev *dev);
40extern void disk_disable(void);
41
42
43#ifndef DOWNLOAD_PROTO_DISK
44#define disk_disable() do { } while(0)
45#endif
46
47#define SECTOR_SIZE 512
48#define SECTOR_SHIFT 9
49
50/* Maximum block_size that may be set. */
51#define DISK_BUFFER_SIZE (18 * SECTOR_SIZE)
52
53#endif /* DISK_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette