| Nico Huber | 5e9b1b5 | 2016-10-08 22:09:33 +0200 | [diff] [blame] | 1 | -- |
| 2 | -- Copyright (C) 2015 secunet Security Networks AG |
| 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; version 2 of the License. |
| 7 | -- |
| 8 | -- This program is distributed in the hope that it will be useful, |
| 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | -- GNU General Public License for more details. |
| 12 | -- |
| 13 | |
| 14 | package HW.Port_IO |
| 15 | with |
| 16 | Abstract_State => (State with External => (Async_Readers, Async_Writers)) |
| 17 | is |
| 18 | |
| 19 | type Port_Type is mod 2**16; |
| 20 | |
| 21 | procedure InB (Value : out Word8; Port : Port_Type) |
| 22 | with |
| 23 | Global => (In_Out => State), |
| 24 | Depends => ((Value, State) => (Port, State)), |
| 25 | Inline_Always; |
| 26 | |
| 27 | procedure InW (Value : out Word16; Port : Port_Type) |
| 28 | with |
| 29 | Global => (In_Out => State), |
| 30 | Depends => ((Value, State) => (Port, State)), |
| 31 | Pre => Port mod 2 = 0, |
| 32 | Inline_Always; |
| 33 | |
| 34 | procedure InL (Value : out Word32; Port : Port_Type) |
| 35 | with |
| 36 | Global => (In_Out => State), |
| 37 | Depends => ((Value, State) => (Port, State)), |
| 38 | Pre => Port mod 4 = 0, |
| 39 | Inline_Always; |
| 40 | |
| 41 | procedure OutB (Port : Port_Type; Value : Word8) |
| 42 | with |
| 43 | Global => (In_Out => State), |
| 44 | Depends => (State =>+ (Port, Value)), |
| 45 | Inline_Always; |
| 46 | |
| 47 | procedure OutW (Port : Port_Type; Value : Word16) |
| 48 | with |
| 49 | Global => (In_Out => State), |
| 50 | Depends => (State =>+ (Port, Value)), |
| 51 | Pre => Port mod 2 = 0, |
| 52 | Inline_Always; |
| 53 | |
| 54 | procedure OutL (Port : Port_Type; Value : Word32) |
| 55 | with |
| 56 | Global => (In_Out => State), |
| 57 | Depends => (State =>+ (Port, Value)), |
| 58 | Pre => Port mod 4 = 0, |
| 59 | Inline_Always; |
| 60 | |
| 61 | end HW.Port_IO; |