source: grub-pc/trunk/fuentes/include/grub/emu/hostdisk.h @ 22

Last change on this file since 22 was 22, checked in by mabarracus, 4 years ago

updated version and apply net.ifnames=0 into debian/rules

File size: 3.0 KB
Line 
1/* biosdisk.h - emulate biosdisk */
2/*
3 *  GRUB  --  GRand Unified Bootloader
4 *  Copyright (C) 2002,2007  Free Software Foundation, Inc.
5 *
6 *  GRUB is free software: you can redistribute it and/or modify
7 *  it under the terms of the GNU General Public License as published by
8 *  the Free Software Foundation, either version 3 of the License, or
9 *  (at your option) any later version.
10 *
11 *  GRUB is distributed in the hope that it will be useful,
12 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *  GNU General Public License for more details.
15 *
16 *  You should have received a copy of the GNU General Public License
17 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef GRUB_BIOSDISK_MACHINE_UTIL_HEADER
21#define GRUB_BIOSDISK_MACHINE_UTIL_HEADER       1
22
23#include <grub/disk.h>
24#include <grub/partition.h>
25#include <sys/types.h>
26#include <grub/emu/hostfile.h>
27
28grub_util_fd_t
29grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
30                          grub_disk_addr_t *max);
31
32void grub_util_biosdisk_init (const char *dev_map);
33void grub_util_biosdisk_fini (void);
34char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
35const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
36int grub_util_biosdisk_is_present (const char *name);
37int grub_util_biosdisk_is_floppy (grub_disk_t disk);
38const char *
39grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
40grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
41grub_err_t
42grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
43const char *
44grub_util_cryptodisk_get_uuid (grub_disk_t disk);
45char *
46grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
47int
48grub_util_is_ldm (grub_disk_t disk);
49#ifdef GRUB_UTIL
50grub_err_t
51grub_util_ldm_embed (struct grub_disk *disk, unsigned int *nsectors,
52                     unsigned int max_nsectors,
53                     grub_embed_type_t embed_type,
54                     grub_disk_addr_t **sectors);
55#endif
56const char *
57grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);
58
59
60char *
61grub_util_get_os_disk (const char *os_dev);
62
63int
64grub_util_get_dm_node_linear_info (dev_t dev,
65                                   int *maj, int *min,
66                                   grub_disk_addr_t *st);
67
68
69/* Supplied by hostdisk_*.c.  */
70grub_int64_t
71grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
72/* REturns partition offset in 512B blocks.  */
73grub_disk_addr_t
74grub_hostdisk_find_partition_start_os (const char *dev);
75void
76grub_hostdisk_flush_initial_buffer (const char *os_dev);
77
78#ifdef __GNU__
79int
80grub_util_hurd_get_disk_info (const char *dev, grub_uint32_t *secsize, grub_disk_addr_t *offset,
81                              grub_disk_addr_t *size, char **parent);
82#endif
83
84struct grub_util_hostdisk_data
85{
86  char *dev;
87  int access_mode;
88  grub_util_fd_t fd;
89  int is_disk;
90  int device_map;
91};
92
93void grub_host_init (void);
94void grub_host_fini (void);
95void grub_hostfs_init (void);
96void grub_hostfs_fini (void);
97
98#endif /* ! GRUB_BIOSDISK_MACHINE_UTIL_HEADER */
Note: See TracBrowser for help on using the repository browser.