diff options
author | Alan Korr <alkorr@rockbox.org> | 2002-04-21 12:21:14 +0000 |
---|---|---|
committer | Alan Korr <alkorr@rockbox.org> | 2002-04-21 12:21:14 +0000 |
commit | b7cf0602fd08f6a367d42f0b6adadb8322b3d35d (patch) | |
tree | abbfb87b615f4c01a5f56eedacd75acbd2e52b87 /firmware/test/fat/fat-mbr_sector.c | |
parent | 257d17da6d64d2e265df3c80192a01f47e1dd2b7 (diff) | |
download | rockbox-b7cf0602fd08f6a367d42f0b6adadb8322b3d35d.tar.gz rockbox-b7cf0602fd08f6a367d42f0b6adadb8322b3d35d.zip |
removing all that stuff permanently.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@159 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/test/fat/fat-mbr_sector.c')
-rw-r--r-- | firmware/test/fat/fat-mbr_sector.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/firmware/test/fat/fat-mbr_sector.c b/firmware/test/fat/fat-mbr_sector.c deleted file mode 100644 index f6b510cea5..0000000000 --- a/firmware/test/fat/fat-mbr_sector.c +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Alan Korr | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #include <fat.h> | ||
20 | #include "fat-mbr_sector.h" | ||
21 | |||
22 | // [Alan]: | ||
23 | // I would like to draw your attention about the fact that SH1 | ||
24 | // cannot use misaligned address access so you must be very cautious | ||
25 | // with structures stored in FAT32 partition because they come from | ||
26 | // PC world where misaligned address accesses are usual and not | ||
27 | // problematic. To avoid such a trouble, I decide to use special | ||
28 | // structures where fields are moved in such a way they can be | ||
29 | // accessed by SH1. It is possible thanks to the callback mechanism | ||
30 | // I use for reading or writing from/to an ATA device in ata.h/c. | ||
31 | // So don't be puzzled if those structures seem odd compared | ||
32 | // with the usual ones from PC world. I use this mechanism for structures | ||
33 | // 'partition_info', 'mbr_sector' and 'fsi_sector' for instance, but | ||
34 | // not for structure 'bpb_sector' which is too much complex to handle | ||
35 | // that way, I think. | ||
36 | // By the way, SH1 is big endian, not little endian as PC is. | ||
37 | |||
38 | /////////////////////////////////////////////////////////////////////////////////// | ||
39 | // MBR SECTOR : | ||
40 | /////////////// | ||
41 | // | ||
42 | // | ||
43 | |||
44 | int __fat_get_mbr_sector_callback (struct __fat_mbr_sector *mbr_sector) | ||
45 | { | ||
46 | short *data = mbr_sector->data,*end; | ||
47 | for (end = mbr_sector->end; data < end; ++data) | ||
48 | *data = ata_get_word (0); | ||
49 | __fat_get_partition_table (mbr_sector->partition_table); | ||
50 | mbr_sector->signature = HI(ATAR_DATA); | ||
51 | return FAT_RETURN_SUCCESS; | ||
52 | } | ||
53 | |||
54 | int __fat_put_mbr_sector_callback (struct __fat_mbr_sector *mbr_sector) | ||
55 | { | ||
56 | short const *data = mbr_sector->data,*end; | ||
57 | for (end = mbr_sector->end; data < end;) | ||
58 | HI(ATAR_DATA) = *data++; | ||
59 | __fat_put_partition_table (mbr_sector->partition_table); | ||
60 | ata_put_word (mbr_sector->signature,0); | ||
61 | return FAT_RETURN_SUCCESS; | ||
62 | } | ||
63 | |||
64 | // | ||
65 | /////////////////////////////////////////////////////////////////////////////////// | ||