-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfs.adb
48 lines (41 loc) · 2.02 KB
/
fs.adb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
-------------------------------------------------------------------------
-- --
-- RTEMS FILE-SYSTEM SUPPORT --
-- --
-- F S --
-- --
-- B o d y --
-- --
-- $ Revision: 1.0 $ --
-- --
-- Alejandro Villanueva Uribarri (Universidad de Zaragoza) --
-- --
-------------------------------------------------------------------------
-------------------------------------------------------------------------
-- This file contains basic type declarations needed by the IDE driver --
-- and the File System. --
-------------------------------------------------------------------------
package body fs is
function To_Byte (Data: in Data_Block;
Pos: in Word)
return Byte is
begin
return Data (Integer (Pos));
end To_Byte;
function To_Word (Data: in Data_Block;
Pos: in Word)
return Word is
begin
return Word (Data (Integer (Pos))) +
Word (Data (Integer (Pos + 1))) * 256;
end To_Word;
function To_DWord (Data: in Data_Block;
Pos: in Word)
return DWord is
begin
return DWord (Data (Integer (Pos))) +
DWord (Data (Integer (Pos + 1))) * 256 +
DWord (Data (Integer (Pos + 2))) * 256**2 +
DWord (Data (Integer (Pos + 3))) * 256**3;
end To_DWord;
end fs;