| Nico Huber | ef4545a | 2017-06-18 02:58:40 +0200 | [diff] [blame] | 1 | -- |
| 2 | -- Copyright (C) 2017 Nico Huber <nico.h@gmx.de> |
| 3 | -- |
| 4 | -- This program is free software; you can redistribute it and/or modify |
| 5 | -- it under the terms of the GNU General Public License as published by |
| 6 | -- the Free Software Foundation; either version 2 of the License, or |
| 7 | -- (at your option) any later version. |
| 8 | -- |
| 9 | -- This program is distributed in the hope that it will be useful, |
| 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | -- GNU General Public License for more details. |
| 13 | -- |
| 14 | |
| 15 | with System; |
| 16 | with HW.MMIO_Range; |
| 17 | |
| 18 | pragma Elaborate_All (HW.MMIO_Range); |
| 19 | |
| Nico Huber | 637f2a4 | 2018-05-15 23:40:30 +0200 | [diff] [blame^] | 20 | generic |
| Nico Huber | ef4545a | 2017-06-18 02:58:40 +0200 | [diff] [blame] | 21 | Dev : Address := (0, 0, 0); |
| 22 | package HW.PCI.MMConf |
| 23 | with |
| 24 | Abstract_State => (Address_State, (PCI_State with External)), |
| 25 | Initializes => Address_State |
| 26 | is |
| 27 | |
| 28 | procedure Read8 (Value : out Word8; Offset : Index); |
| 29 | procedure Read16 (Value : out Word16; Offset : Index) |
| 30 | with |
| 31 | Pre => Offset mod 2 = 0; |
| 32 | procedure Read32 (Value : out Word32; Offset : Index) |
| 33 | with |
| 34 | Pre => Offset mod 4 = 0; |
| 35 | |
| 36 | procedure Write8 (Offset : Index; Value : Word8); |
| 37 | procedure Write16 (Offset : Index; Value : Word16) |
| 38 | with |
| 39 | Pre => Offset mod 2 = 0; |
| 40 | procedure Write32 (Offset : Index; Value : Word32) |
| 41 | with |
| 42 | Pre => Offset mod 4 = 0; |
| 43 | |
| 44 | procedure Set_Base_Address (Base : Word64); |
| 45 | |
| 46 | end HW.PCI.MMConf; |