summaryrefslogtreecommitdiff
path: root/mach-defpager/file_io.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-02-28 08:34:01 +0000
committerRoland McGrath <roland@gnu.org>2001-02-28 08:34:01 +0000
commitadf34ebbd7f683873c260de5d09d989f017e1701 (patch)
treef0aee36e798c0d3dedd42c18d14cb59c7ac48305 /mach-defpager/file_io.h
parentb1d8a9aa0d80fced013dc216f20f725e570256f9 (diff)
2000-12-28 Roland McGrath <roland@frob.com>
Override the shared code from serverboot for device access with a new, simpler implementation with no filesystem format support. The new code implements the new default_pager_paging_storage RPC to set up paging areas that can be subsets of whole Mach devices, with no Linux signature checking. The compatibility setup entry point works as before on whole devices. * setup.c, file_io.h: New files. * Makefile (SRCS): Remove def_pager_setup.c, file_io.c, strfcns.c, ext2_file_io.c, ffs_file_io.c, ffs_compat.c, minix_file_io.c, minix_ffs_compat.c; add setup.c to replace them all.
Diffstat (limited to 'mach-defpager/file_io.h')
-rw-r--r--mach-defpager/file_io.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/mach-defpager/file_io.h b/mach-defpager/file_io.h
new file mode 100644
index 00000000..d0b03f33
--- /dev/null
+++ b/mach-defpager/file_io.h
@@ -0,0 +1,69 @@
+/* Backing store access callbacks for Hurd version of Mach default pager.
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+ This file is part of the GNU Hurd.
+
+ The GNU Hurd is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ The GNU Hurd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _file_io_h
+#define _file_io_h 1
+
+/* The original Mach default pager code used in serverboot can read
+ filesystem meta-data to find the blocks used by paging files.
+ We replace those interfaces with simpler code that only supports
+ subsets of devices represented by a list of runs a la libstore. */
+
+#include <sys/types.h>
+
+#include <device/device_types.h>
+#include <device/device.h>
+
+/* A run of device records, expressed in the device's record size. */
+struct storage_run
+{
+ recnum_t start, length;
+};
+
+struct file_direct
+{
+ mach_port_t device;
+
+ int bshift; /* size of device records (disk blocks) */
+ size_t fd_bsize; /* log2 of that */
+ recnum_t fd_size; /* number of blocks total */
+
+ /* The paging area consists of the concatentation of NRUNS contiguous
+ regions of the device, as described by RUNS. */
+ size_t nruns;
+ struct storage_run runs[0];
+};
+
+/* These are in fact only called to read or write a single page, from
+ default_pager.c::default_read/default_write. The SIZE argument is
+ always vm_page_size and OFFSET is always page-aligned. */
+
+int page_read_file_direct (struct file_direct *fdp,
+ vm_offset_t offset,
+ vm_size_t size,
+ vm_offset_t *addr, /* out */
+ mach_msg_type_number_t *size_read); /* out */
+int page_write_file_direct(struct file_direct *fdp,
+ vm_offset_t offset,
+ vm_offset_t addr,
+ vm_size_t size,
+ vm_offset_t *size_written); /* out */
+
+
+#endif /* file_io.h */