| 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 | generic |
| 16 | Dev : PCI.Address := (0, 0, 0); |
| Nico Huber | 61f7287 | 2020-06-10 15:53:35 +0200 | [diff] [blame^] | 17 | MMConf_Base : Word64 := 0; |
| Nico Huber | ef4545a | 2017-06-18 02:58:40 +0200 | [diff] [blame] | 18 | package HW.PCI.Dev |
| 19 | with |
| 20 | Abstract_State => (Address_State, (PCI_State with External)), |
| 21 | Initializes => Address_State |
| 22 | is |
| 23 | |
| 24 | procedure Read8 (Value : out Word8; Offset : Index); |
| 25 | procedure Read16 (Value : out Word16; Offset : Index) |
| 26 | with |
| 27 | Pre => Offset mod 2 = 0; |
| 28 | procedure Read32 (Value : out Word32; Offset : Index) |
| 29 | with |
| 30 | Pre => Offset mod 4 = 0; |
| 31 | |
| 32 | procedure Write8 (Offset : Index; Value : Word8); |
| 33 | procedure Write16 (Offset : Index; Value : Word16) |
| 34 | with |
| 35 | Pre => Offset mod 2 = 0; |
| 36 | procedure Write32 (Offset : Index; Value : Word32) |
| 37 | with |
| 38 | Pre => Offset mod 4 = 0; |
| 39 | |
| Nico Huber | ae9b855 | 2017-07-09 15:25:41 +0200 | [diff] [blame] | 40 | pragma Warnings (GNATprove, Off, "unused variable ""WC""*", |
| 41 | Reason => "Used for a common interface"); |
| Nico Huber | ef4545a | 2017-06-18 02:58:40 +0200 | [diff] [blame] | 42 | procedure Map |
| 43 | (Addr : out Word64; |
| 44 | Res : in Resource; |
| 45 | Length : in Natural := 0; |
| 46 | Offset : in Natural := 0; |
| 47 | WC : in Boolean := False); |
| Nico Huber | ae9b855 | 2017-07-09 15:25:41 +0200 | [diff] [blame] | 48 | pragma Warnings (GNATprove, On, "unused variable ""WC""*"); |
| Nico Huber | ef4545a | 2017-06-18 02:58:40 +0200 | [diff] [blame] | 49 | |
| 50 | procedure Resource_Size (Length : out Natural; Res : Resource); |
| 51 | |
| Nico Huber | ff3240b | 2017-07-09 16:23:04 +0200 | [diff] [blame] | 52 | pragma Warnings (GNATprove, Off, "unused variable ""MMConf_Base""*", |
| 53 | Reason => "Used for a common interface"); |
| Nico Huber | 61f7287 | 2020-06-10 15:53:35 +0200 | [diff] [blame^] | 54 | procedure Initialize |
| 55 | (Success : out Boolean; |
| 56 | MMConf_Base : in Word64 := PCI.Dev.MMConf_Base); |
| Nico Huber | ff3240b | 2017-07-09 16:23:04 +0200 | [diff] [blame] | 57 | pragma Warnings (GNATprove, On, "unused variable ""MMConf_Base""*"); |
| Nico Huber | ef4545a | 2017-06-18 02:58:40 +0200 | [diff] [blame] | 58 | |
| 59 | end HW.PCI.Dev; |