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 /* Forward declaration: */
39 extern EFI_STATUS fops_open(CHAR16 *name, fops_fd_t *fd);
40 extern EFI_STATUS fops_read(fops_fd_t fd,VOID *buf, UINTN *size);
41 extern EFI_STATUS fops_close(fops_fd_t fd);
42 extern EFI_STATUS fops_infosize(fops_fd_t fd, UINT64 *size);
43 extern EFI_STATUS fops_seek(fops_fd_t fd, UINT64 newpos);
44 extern EFI_STATUS fops_setdefaults(struct config_file *defconf, CHAR16 *kname, UINTN maxlen, CHAR16 *devpath);
45 extern EFI_STATUS fops_getdefault_path(CHAR16 *path, UINTN maxlen);
46 extern CHAR16 *fops_bootdev_name(VOID);
50 * fileops interface used by underlying filesystems layer
53 typedef EFI_STATUS (*fops_open_t)(VOID *intf, CHAR16 *name, fops_fd_t *fd);
54 typedef EFI_STATUS (*fops_read_t)(VOID *intf, fops_fd_t fd, VOID *buf, UINTN *size);
55 typedef EFI_STATUS (*fops_close_t)(VOID *intf, fops_fd_t fd);
56 typedef EFI_STATUS (*fops_infosize_t)(VOID *intf, fops_fd_t fd, UINT64 *size);
57 typedef EFI_STATUS (*fops_seek_t)(VOID *intf, fops_fd_t fd, UINT64 newpos);
58 typedef EFI_STATUS (*fops_setdefaults_t)(VOID *intf, struct config_file *defconfs, CHAR16 *kname, UINTN maxlen, CHAR16 *devpath);
59 typedef EFI_STATUS (*fops_getdefault_path_t)(CHAR16 *path, UINTN maxlen);
62 VOID *intf; /* pointer to underlying interface */
67 fops_infosize_t infosize;
69 fops_setdefaults_t setdefaults;
70 fops_getdefault_path_t getdefault_path;
72 EFI_HANDLE dev; /* handle on device on which proto is installed */
73 CHAR16 name[FILEOPS_NAME_MAXLEN];
77 * used to register a new filsystem
79 typedef INTN (*fops_fs_glue_t)(fileops_t *this, VOID *intf);
80 typedef EFI_STATUS (*fops_fs_install_t)(VOID);
81 typedef EFI_STATUS (*fops_fs_uninstall_t)(VOID);
84 EFI_GUID proto; /* GUID of filesystem */
85 fops_fs_glue_t glue; /* glue routine */
86 fops_fs_install_t install; /* to go away with real EFI drivers */
87 fops_fs_uninstall_t uninstall; /* to go away with real EFI drivers */
94 #define FILEOPS_DEVNAME_MAXLEN 16
99 CHAR16 name[FILEOPS_DEVNAME_MAXLEN];
102 extern INTN init_devices(EFI_HANDLE boot_handle);
103 extern INTN close_devices(VOID);
104 extern VOID print_devices(VOID);
105 extern EFI_STATUS fops_get_next_device(UINTN pidx, CHAR16 *type, UINTN maxlen, UINTN *idx, CHAR16 *name, EFI_HANDLE *dev);
106 extern INTN fops_split_path(CHAR16 *path, CHAR16 *dev);
107 extern EFI_STATUS fops_get_device_handle(CHAR16 *name, EFI_HANDLE *dev);
110 * device naming schemes
113 * the scheme() function arguments are:
114 * - the list of detected bootable device
115 * - the number of entries in that table as argument
117 * There is no expected return value. If the scheme() cannot perform
118 * its tasks, then IT MUST NOT OVERWRITE the generic naming scheme (devXXX) that
119 * is ALWAYS installed by default. Partial modifications are possible, although
124 INTN (*install_scheme)(device_t *tab, UINTN ndev);
127 #endif /* __FILEOPS_H__ */