blob: d738d7563005f2c28cc0e36496957420daf7e267 [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
Thomas Heijligen936a9d82024-01-22 11:52:39 +00007 (Buffer : 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,
Nico Huberf01abce2024-01-23 16:18:33 +010025 External_Name => "devread";
Nico Huberc6bd3d32023-11-27 17:13:37 +010026
Thomas Heijligen5c43abc2023-12-11 15:24:36 +000027end FILO.Blockdev;