Nico Huber | c6bd3d3 | 2023-11-27 17:13:37 +0100 | [diff] [blame] | 1 | with Interfaces.C; |
| 2 | with System; |
| 3 | |
Thomas Heijligen | 5c43abc | 2023-12-11 15:24:36 +0000 | [diff] [blame] | 4 | package FILO.Blockdev is |
Nico Huber | c6bd3d3 | 2023-11-27 17:13:37 +0100 | [diff] [blame] | 5 | |
| 6 | Procedure Read |
| 7 | (Buffer : in out Buffer_Type; |
Nico Huber | 9c04187 | 2023-12-12 13:24:55 +0100 | [diff] [blame^] | 8 | Offset : in Blockdev_Offset; |
| 9 | Success : out Boolean) |
| 10 | with |
| 11 | Pre => Offset <= Blockdev_Length'Last - Buffer'Length; |
Nico Huber | c6bd3d3 | 2023-11-27 17:13:37 +0100 | [diff] [blame] | 12 | |
| 13 | private |
| 14 | |
| 15 | function C_devread |
Thomas Heijligen | 5c43abc | 2023-12-11 15:24:36 +0000 | [diff] [blame] | 16 | (sector : Interfaces.C.unsigned_long; |
Nico Huber | c6bd3d3 | 2023-11-27 17:13:37 +0100 | [diff] [blame] | 17 | byte_offset : Interfaces.C.unsigned_long; |
Thomas Heijligen | 5c43abc | 2023-12-11 15:24:36 +0000 | [diff] [blame] | 18 | byte_len : Interfaces.C.unsigned_long; |
| 19 | buf : System.Address) |
| 20 | return Interfaces.C.int |
Nico Huber | c6bd3d3 | 2023-11-27 17:13:37 +0100 | [diff] [blame] | 21 | with |
| 22 | SPARK_Mode => Off, |
| 23 | Import => True, |
| 24 | Convention => C, |
| 25 | External_Name => "devopen"; |
| 26 | |
Thomas Heijligen | 5c43abc | 2023-12-11 15:24:36 +0000 | [diff] [blame] | 27 | end FILO.Blockdev; |