2 * Copyright (C) 2001-2003 Hewlett-Packard Co.
3 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
5 * This file is part of the ELILO, the EFI Linux boot loader.
7 * GNU EFI is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * GNU EFI is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU EFI; see the file COPYING. If not, write to the Free
19 * Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 * Please check out the elilo.txt for complete documentation on how
23 * to use this program.
29 #define FILEOPS_NAME_MAXLEN 32 /* length of filesystem name */
32 * upper-level interface used by the bootloader
34 typedef UINTN fops_fd_t;
36 extern EFI_STATUS fops_open(CHAR16 *name, fops_fd_t *fd);
37 extern EFI_STATUS fops_read(fops_fd_t fd,VOID *buf, UINTN *size);
38 extern EFI_STATUS fops_close(fops_fd_t fd);
39 extern EFI_STATUS fops_infosize(fops_fd_t fd, UINT64 *size);
40 extern EFI_STATUS fops_seek(fops_fd_t fd, UINT64 newpos);
41 extern EFI_STATUS fops_setdefaults(CHAR16 *config, CHAR16 *kname, UINTN maxlen, CHAR16 *devpath);
42 extern EFI_STATUS fops_getdefault_path(CHAR16 *path, UINTN maxlen);
43 extern CHAR16 *fops_bootdev_name(VOID);
47 * fileops interface used by underlying filesystems layer
49 typedef EFI_STATUS (*fops_open_t)(VOID *intf, CHAR16 *name, fops_fd_t *fd);
50 typedef EFI_STATUS (*fops_read_t)(VOID *intf, fops_fd_t fd, VOID *buf, UINTN *size);
51 typedef EFI_STATUS (*fops_close_t)(VOID *intf, fops_fd_t fd);
52 typedef EFI_STATUS (*fops_infosize_t)(VOID *intf, fops_fd_t fd, UINT64 *size);
53 typedef EFI_STATUS (*fops_seek_t)(VOID *intf, fops_fd_t fd, UINT64 newpos);
54 typedef EFI_STATUS (*fops_setdefaults_t)(VOID *intf, CHAR16 *config, CHAR16 *kname, UINTN maxlen, CHAR16 *devpath);
55 typedef EFI_STATUS (*fops_getdefault_path_t)(CHAR16 *path, UINTN maxlen);
58 VOID *intf; /* pointer to underlying interface */
63 fops_infosize_t infosize;
65 fops_setdefaults_t setdefaults;
66 fops_getdefault_path_t getdefault_path;
68 EFI_HANDLE dev; /* handle on device on which proto is installed */
69 CHAR16 name[FILEOPS_NAME_MAXLEN];
73 * used to register a new filsystem
75 typedef INTN (*fops_fs_glue_t)(fileops_t *this, VOID *intf);
76 typedef EFI_STATUS (*fops_fs_install_t)(VOID);
77 typedef EFI_STATUS (*fops_fs_uninstall_t)(VOID);
80 EFI_GUID proto; /* GUID of filesystem */
81 fops_fs_glue_t glue; /* glue routine */
82 fops_fs_install_t install; /* to go away with real EFI drivers */
83 fops_fs_uninstall_t uninstall; /* to go away with real EFI drivers */
90 #define FILEOPS_DEVNAME_MAXLEN 16
95 CHAR16 name[FILEOPS_DEVNAME_MAXLEN];
98 extern INTN init_devices(EFI_HANDLE boot_handle);
99 extern INTN close_devices(VOID);
100 extern VOID print_devices(VOID);
101 extern EFI_STATUS fops_get_next_device(UINTN pidx, CHAR16 *type, UINTN maxlen, UINTN *idx, CHAR16 *name, EFI_HANDLE *dev);
102 extern INTN fops_split_path(CHAR16 *path, CHAR16 *dev);
103 extern EFI_STATUS fops_get_device_handle(CHAR16 *name, EFI_HANDLE *dev);
106 * device naming schemes
109 * the scheme() function arguments are:
110 * - the list of detected bootable device
111 * - the number of entries in that table as argument
113 * There is no expected return value. If the scheme() cannot perform
114 * its tasks, then IT MUST NOT OVERWRITE the generic naming scheme (devXXX) that
115 * is ALWAYS installed by default. Partial modifications are possible, although
120 INTN (*install_scheme)(device_t *tab, UINTN ndev);
123 #endif /* __FILEOPS_H__ */