Fix cross compilation (e.g. on Darwin). Following changes to make.tmpl,
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / emu / hostdisk.h
blobe006f0b38bd6125b152721c668974509d965233f
1 /* biosdisk.h - emulate biosdisk */
2 /*
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2002,2007 Free Software Foundation, Inc.
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.
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.
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/>.
20 #ifndef GRUB_BIOSDISK_MACHINE_UTIL_HEADER
21 #define GRUB_BIOSDISK_MACHINE_UTIL_HEADER 1
23 #include <grub/disk.h>
24 #include <grub/partition.h>
25 #include <sys/types.h>
26 #include <grub/emu/hostfile.h>
28 grub_util_fd_t
29 grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
30 grub_disk_addr_t *max);
32 void grub_util_biosdisk_init (const char *dev_map);
33 void grub_util_biosdisk_fini (void);
34 char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
35 const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
36 int grub_util_biosdisk_is_present (const char *name);
37 int grub_util_biosdisk_is_floppy (grub_disk_t disk);
38 const char *
39 grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk);
40 grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk);
41 grub_err_t
42 grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
43 const char *
44 grub_util_cryptodisk_get_uuid (grub_disk_t disk);
45 char *
46 grub_util_get_ldm (grub_disk_t disk, grub_disk_addr_t start);
47 int
48 grub_util_is_ldm (grub_disk_t disk);
49 #ifdef GRUB_UTIL
50 grub_err_t
51 grub_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
56 const char *
57 grub_hostdisk_os_dev_to_grub_drive (const char *os_dev, int add);
60 char *
61 grub_util_get_os_disk (const char *os_dev);
63 int
64 grub_util_get_dm_node_linear_info (dev_t dev,
65 int *maj, int *min,
66 grub_disk_addr_t *st);
69 /* Supplied by hostdisk_*.c. */
70 grub_int64_t
71 grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_secsize);
72 /* REturns partition offset in 512B blocks. */
73 grub_disk_addr_t
74 grub_hostdisk_find_partition_start_os (const char *dev);
75 void
76 grub_hostdisk_flush_initial_buffer (const char *os_dev);
78 #ifdef __GNU__
79 int
80 grub_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
84 struct grub_util_hostdisk_data
86 char *dev;
87 int access_mode;
88 grub_util_fd_t fd;
89 int is_disk;
90 int device_map;
93 void grub_host_init (void);
94 void grub_host_fini (void);
95 void grub_hostfs_init (void);
96 void grub_hostfs_fini (void);
98 #endif /* ! GRUB_BIOSDISK_MACHINE_UTIL_HEADER */