blob: 2fde36abb677b20d936cae5f55c4562e9741345f [file] [log] [blame]
Nico Huberc6bd3d32023-11-27 17:13:37 +01001with Interfaces.C;
2with System;
3
Thomas Heijligen5c43abc2023-12-11 15:24:36 +00004package FILO.Blockdev is
Nico Huberc6bd3d32023-11-27 17:13:37 +01005
6 Procedure Read
7 (Buffer : in out Buffer_Type;
Nico Huber9c041872023-12-12 13:24:55 +01008 Offset : in Blockdev_Offset;
9 Success : out Boolean)
10 with
11 Pre => Offset <= Blockdev_Length'Last - Buffer'Length;
Nico Huberc6bd3d32023-11-27 17:13:37 +010012
13private
14
15 function C_devread
Thomas Heijligen5c43abc2023-12-11 15:24:36 +000016 (sector : Interfaces.C.unsigned_long;
Nico Huberc6bd3d32023-11-27 17:13:37 +010017 byte_offset : Interfaces.C.unsigned_long;
Thomas Heijligen5c43abc2023-12-11 15:24:36 +000018 byte_len : Interfaces.C.unsigned_long;
19 buf : System.Address)
20 return Interfaces.C.int
Nico Huberc6bd3d32023-11-27 17:13:37 +010021 with
22 SPARK_Mode => Off,
23 Import => True,
24 Convention => C,
25 External_Name => "devopen";
26
Thomas Heijligen5c43abc2023-12-11 15:24:36 +000027end FILO.Blockdev;