Nico Huber | c6bd3d3 | 2023-11-27 17:13:37 +0100 | [diff] [blame^] | 1 | package body FS.FILO.Dev is |
Thomas Heijligen | d1e0457 | 2023-11-27 14:28:55 +0000 | [diff] [blame] | 2 | |
| 3 | procedure Read |
Thomas Heijligen | 62268ee | 2023-11-27 15:10:41 +0000 | [diff] [blame] | 4 | (Buffer : in out Buffer_Type; |
| 5 | Offset : in Natural; |
| 6 | Success : out Boolean) |
Thomas Heijligen | d1e0457 | 2023-11-27 14:28:55 +0000 | [diff] [blame] | 7 | is |
Thomas Heijligen | 62268ee | 2023-11-27 15:10:41 +0000 | [diff] [blame] | 8 | --Sector_Size : constant Natural := 512; |
| 9 | --Sector : constant Interfaces.C.unsigned_long := Offset / Sector_Size; |
| 10 | --Byte_Offset : constant Interfaces.C.unsigned_long := Offset rem Sector_Size; |
| 11 | --Byte_Len : constant Interfaces.C.unsigned_long := Buffer'Length; |
| 12 | --function To_Bool(Item : Interfaces.C.int) return Bool is |
| 13 | -- (if Item = 0 then False else True); |
Thomas Heijligen | d1e0457 | 2023-11-27 14:28:55 +0000 | [diff] [blame] | 14 | begin |
Thomas Heijligen | 62268ee | 2023-11-27 15:10:41 +0000 | [diff] [blame] | 15 | null; |
| 16 | --Success := To_Bool (C_devread (Sector, Byte_Offset, Byte_Len, Buffer'Address)); |
Thomas Heijligen | d1e0457 | 2023-11-27 14:28:55 +0000 | [diff] [blame] | 17 | end Read; |
| 18 | |
Nico Huber | c6bd3d3 | 2023-11-27 17:13:37 +0100 | [diff] [blame^] | 19 | end FS.FILO.Dev; |