]> git.proxmox.com Git - qemu.git/blob - hw/block-common.h
hd-geometry: Compute BIOS CHS translation in one place
[qemu.git] / hw / block-common.h
1 /*
2 * Common code for block device models
3 *
4 * Copyright (C) 2012 Red Hat, Inc.
5 * Copyright (c) 2003-2008 Fabrice Bellard
6 *
7 * This work is licensed under the terms of the GNU GPL, version 2 or
8 * later. See the COPYING file in the top-level directory.
9 */
10
11 #ifndef HW_BLOCK_COMMON_H
12 #define HW_BLOCK_COMMON_H
13
14 #include "qemu-common.h"
15
16 /* Hard disk geometry */
17
18 #define BIOS_ATA_TRANSLATION_AUTO 0
19 #define BIOS_ATA_TRANSLATION_NONE 1
20 #define BIOS_ATA_TRANSLATION_LBA 2
21 #define BIOS_ATA_TRANSLATION_LARGE 3
22 #define BIOS_ATA_TRANSLATION_RECHS 4
23
24 void hd_geometry_guess(BlockDriverState *bs,
25 uint32_t *pcyls, uint32_t *pheads, uint32_t *psecs,
26 int *ptrans);
27 int hd_bios_chs_auto_trans(uint32_t cyls, uint32_t heads, uint32_t secs);
28
29 #endif