summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorJoan Lledó <joanlluislledo@gmail.com>2018-01-16 12:54:28 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-10-30 00:47:36 +0100
commita830bef66e689f6f1defa9988f257a7ec2bb034d (patch)
tree3d49249a05195148fc8a8e6a84f9c56b46dbab7b /hurd
parent6783a1b124eff9383571dfd4b5e83a03ee63866a (diff)
PCI Arbiter
Diffstat (limited to 'hurd')
-rw-r--r--hurd/hurd_types.defs19
-rw-r--r--hurd/hurd_types.h24
-rw-r--r--hurd/paths.h3
-rw-r--r--hurd/pci.defs73
-rw-r--r--hurd/subsystems1
5 files changed, 118 insertions, 2 deletions
diff --git a/hurd/hurd_types.defs b/hurd/hurd_types.defs
index 4d7013c8..0e9b990e 100644
--- a/hurd/hurd_types.defs
+++ b/hurd/hurd_types.defs
@@ -1,5 +1,5 @@
/* MiG type declarations for Hurd interfaces -*- C -*-
- Copyright (C) 1993,94,95,96,98,2001,02 Free Software Foundation, Inc.
+ Copyright (C) 1993,94,95,96,98,2001,02,17 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -296,6 +296,23 @@ destructor: INTERRUPT_DESTRUCTOR
#endif
;
+/* PCI arbiter */
+type pci_t = mach_port_copy_send_t
+#ifdef PCI_INTRAN
+intran: PCI_INTRAN
+intranpayload: PCI_INTRAN_PAYLOAD
+#else
+#ifdef HURD_DEFAULT_PAYLOAD_TO_PORT
+intranpayload: pci_t HURD_DEFAULT_PAYLOAD_TO_PORT
+#endif
+#endif
+#ifdef PCI_OUTTRAN
+outtran: PCI_OUTTRAN
+#endif
+#ifdef PCI_DESTRUCTOR
+destructor: PCI_DESTRUCTOR
+#endif
+;
type proccoll_t = mach_port_copy_send_t;
diff --git a/hurd/hurd_types.h b/hurd/hurd_types.h
index 4d68b36b..eb06029b 100644
--- a/hurd/hurd_types.h
+++ b/hurd/hurd_types.h
@@ -1,6 +1,6 @@
/* C declarations for Hurd server interfaces
Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002,
- 2010 Free Software Foundation, Inc.
+ 2010, 2017 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -51,6 +51,7 @@ typedef mach_port_t exec_startup_t;
typedef mach_port_t interrupt_t;
typedef mach_port_t proccoll_t;
typedef mach_port_t ctty_t;
+typedef mach_port_t pci_t;
#include <errno.h> /* Defines `error_t'. */
@@ -358,6 +359,7 @@ typedef const int *const_procinfo_t;
#define FSTYPE_HTTP 0x00000018 /* Transparent HTTP */
#define FSTYPE_MEMFS 0x00000019 /* In-core filesystem */
#define FSTYPE_ISO9660 0x0000001a /* ISO9660 */
+#define FSTYPE_PCI 0x0000001b /* PCI filesystem */
/* Standard port assignments for file_exec_paths and exec_* */
enum
@@ -384,4 +386,24 @@ enum
INIT_INT_MAX,
};
+/* PCI arbiter types*/
+#include <stdint.h>
+
+/* Memory region */
+struct pci_bar
+ {
+ uint64_t base_addr;
+ uint64_t size;
+ unsigned is_IO:1;
+ unsigned is_prefetchable:1;
+ unsigned is_64:1;
+ };
+
+/* Expansion ROM region */
+struct pci_xrom_bar
+ {
+ uint64_t base_addr;
+ uint64_t size;
+ };
+
#endif
diff --git a/hurd/paths.h b/hurd/paths.h
index e1b00e90..10ae3a6f 100644
--- a/hurd/paths.h
+++ b/hurd/paths.h
@@ -36,6 +36,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
in simple decimal (e.g. "/servers/socket/23"). */
#define _SERVERS_SOCKET _SERVERS "socket"
+/* Directory containing virtual filesystems for buses */
+#define _SERVERS_BUS _SERVERS "bus"
+
/* Hurd servers are specified by symbols _HURD_FOO,
the canonical pathname being /hurd/foo. */
diff --git a/hurd/pci.defs b/hurd/pci.defs
new file mode 100644
index 00000000..23c90334
--- /dev/null
+++ b/hurd/pci.defs
@@ -0,0 +1,73 @@
+/* Definitions for pci-specific calls
+ Copyright (C) 2017 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 the GNU Hurd; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+subsystem pci 39000;
+
+#include <hurd/hurd_types.defs>
+
+#ifdef PCI_IMPORTS
+PCI_IMPORTS
+INTR_INTERFACE
+#endif
+
+/*
+ * Read 'amount' bytes from offset 'reg' in the
+ * configuration space and store it in 'data'
+ */
+routine pci_conf_read (
+ master: pci_t;
+ reg: int;
+ out data: data_t, dealloc;
+ amount: vm_size_t
+);
+
+/* Write 'amount' bytes from 'data' to offset 'reg' in the config space */
+routine pci_conf_write(
+ master: pci_t;
+ reg: int;
+ data: data_t;
+ out amount: vm_size_t
+);
+
+/*
+ * Calculate the number of devices that are allowed
+ * for the user and return it in 'numdevs'.
+ */
+routine pci_get_ndevs(
+ master: pci_t;
+ out ndevs: vm_size_t
+);
+
+/*
+ * Return the memory regions for a specified device.
+ * `data' is an array of 6 struct pci_bar
+ */
+routine pci_get_dev_regions(
+ master: pci_t;
+ out data: data_t, dealloc
+);
+
+/*
+ * Return the expansion ROM bar for a given device.
+ * `data' is a struct pci_xrom_bar
+ */
+routine pci_get_dev_rom(
+ master: pci_t;
+ out data: data_t, dealloc
+);
diff --git a/hurd/subsystems b/hurd/subsystems
index c05895c2..0677bb1e 100644
--- a/hurd/subsystems
+++ b/hurd/subsystems
@@ -36,6 +36,7 @@ tape 35000 Special control operations for magtapes
login 36000 Database of logged-in users
pfinet 37000 Internet configuration calls
password 38000 Password checker
+pci 39000 PCI arbiter
<ioctl space> 100000- First subsystem of ioctl class 'f' (lowest class)
tioctl 156000 Ioctl class 't' (terminals)
tioctl 156200 (continued)