summaryrefslogtreecommitdiff
path: root/firmware/test/fat/fat-mbr_sector.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/test/fat/fat-mbr_sector.h')
-rw-r--r--firmware/test/fat/fat-mbr_sector.h69
1 files changed, 0 insertions, 69 deletions
diff --git a/firmware/test/fat/fat-mbr_sector.h b/firmware/test/fat/fat-mbr_sector.h
deleted file mode 100644
index 11f131e440..0000000000
--- a/firmware/test/fat/fat-mbr_sector.h
+++ /dev/null
@@ -1,69 +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#ifndef __LIBRARY_FAT_MBR_SECTOR_H__
20#define __LIBRARY_FAT_MBR_SECTOR_H__
21#include "fat-partition.h"
22
23// [Alan]:
24// I would like to draw your attention about the fact that SH1
25// cannot use misaligned address access so you must be very cautious
26// with structures stored in FAT32 partition because they come from
27// PC world where misaligned address accesses are usual and not
28// problematic. To avoid such a trouble, I decide to use special
29// structures where fields are moved in such a way they can be
30// accessed by SH1. It is possible thanks to the callback mechanism
31// I use for reading or writing from/to an ATA device in ata.h/c.
32// So don't be puzzled if those structures seem odd compared
33// with the usual ones from PC world. I use this mechanism for structures
34// 'partition_info', 'mbr_sector' and 'fsi_sector' for instance, but
35// not for structure 'bpb_sector' which is too much complex to handle
36// that way, I think.
37// By the way, SH1 is big endian, not little endian as PC is.
38
39///////////////////////////////////////////////////////////////////////////////////
40// MBR SECTOR :
41///////////////
42//
43//
44
45struct __fat_mbr_sector /* Master Boot Record Sector */
46 {
47 struct
48 __fat_partition_info partition_table[4];
49 short
50 data[0x1BE/2];
51 short
52 end[0];
53 short
54 signature;
55 };
56
57int __fat_get_mbr_sector_callback (struct __fat_mbr_sector *mbr_sector);
58int __fat_put_mbr_sector_callback (struct __fat_mbr_sector *mbr_sector);
59
60static inline int __fat_get_mbr_sector (struct mbr_sector *__fat_mbr_sector)
61 { return ata_read_sectors (0,1,mbr_sector,(int(*)(void *))__fat_get_mbr_sector_callback); }
62
63static inline int __fat_put_mbr_sector (struct mbr_sector *__fat_mbr_sector)
64 { return ata_write_sectors (0,1,mbr_sector,(int(*)(void *))__fat_put_mbr_sector_callback); }
65
66//
67///////////////////////////////////////////////////////////////////////////////////
68
69#endif \ No newline at end of file