freemyipod r48 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r47‎ | r48 | r49 >
Date:12:29, 7 August 2010
Author:farthen
Status:new
Tags:
Comment:
Fix my last commit
Modified paths:
  • /embios/trunk/disk.h (added) (history)
  • /embios/trunk/mv.h (added) (history)

Diff [purge]

Index: embios/trunk/mv.h
@@ -0,0 +1,53 @@
 2+/***************************************************************************
 3+ * __________ __ ___.
 4+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
 5+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
 6+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
 7+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
 8+ * \/ \/ \/ \/ \/
 9+ * $Id: mv.h 21933 2009-07-17 22:28:49Z gevaerts $
 10+ *
 11+ * Copyright (C) 2008 by Frank Gevaerts
 12+ *
 13+ * This program is free software; you can redistribute it and/or
 14+ * modify it under the terms of the GNU General Public License
 15+ * as published by the Free Software Foundation; either version 2
 16+ * of the License, or (at your option) any later version.
 17+ *
 18+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 19+ * KIND, either express or implied.
 20+ *
 21+ ****************************************************************************/
 22+
 23+#ifndef __MV_H__
 24+#define __MV_H__
 25+
 26+#include "config.h"
 27+
 28+/* FixMe: These macros are a bit nasty and perhaps misplaced here.
 29+ We'll get rid of them once decided on how to proceed with multivolume. */
 30+
 31+/* Drives are things like a disk, a card, a flash chip. They can have volumes on them */
 32+#ifdef HAVE_MULTIDRIVE
 33+#define IF_MD(x) x /* optional drive parameter */
 34+#define IF_MD2(x,y) x,y /* same, for a list of arguments */
 35+#define IF_MD_NONVOID(x) x /* for prototype with sole volume parameter */
 36+#else /* empty definitions if no multi-drive */
 37+#define IF_MD(x)
 38+#define IF_MD2(x,y)
 39+#define IF_MD_NONVOID(x) void
 40+#endif
 41+
 42+/* Volumes mean things that have filesystems on them, like partitions */
 43+#ifdef HAVE_MULTIVOLUME
 44+#define IF_MV(x) x /* optional volume parameter */
 45+#define IF_MV2(x,y) x,y /* same, for a list of arguments */
 46+#define IF_MV_NONVOID(x) x /* for prototype with sole volume parameter */
 47+#else /* empty definitions if no multi-volume */
 48+#define IF_MV(x)
 49+#define IF_MV2(x,y)
 50+#define IF_MV_NONVOID(x) void
 51+#endif
 52+
 53+
 54+#endif
Index: embios/trunk/disk.h
@@ -0,0 +1,56 @@
 2+/***************************************************************************
 3+ * __________ __ ___.
 4+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
 5+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
 6+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
 7+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
 8+ * \/ \/ \/ \/ \/
 9+ * $Id: disk.h 26629 2010-06-06 13:28:13Z gevaerts $
 10+ *
 11+ * Copyright (C) 2002 by Björn Stenberg
 12+ *
 13+ * This program is free software; you can redistribute it and/or
 14+ * modify it under the terms of the GNU General Public License
 15+ * as published by the Free Software Foundation; either version 2
 16+ * of the License, or (at your option) any later version.
 17+ *
 18+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 19+ * KIND, either express or implied.
 20+ *
 21+ ****************************************************************************/
 22+#ifndef _DISK_H_
 23+#define _DISK_H_
 24+
 25+#include "mv.h" /* for volume definitions */
 26+
 27+struct partinfo {
 28+ unsigned long start; /* first sector (LBA) */
 29+ unsigned long size; /* number of sectors */
 30+ unsigned char type;
 31+};
 32+
 33+/* FIXME: This sets the drive count to 1. This should belong to the device itself */
 34+#define NUM_DRIVES 1
 35+#define NUM_VOLUMES 1
 36+#define NUM_VOLUMES_PER_DRIVE 1
 37+
 38+#define PARTITION_TYPE_FAT32 0x0b
 39+#define PARTITION_TYPE_FAT32_LBA 0x0c
 40+#define PARTITION_TYPE_FAT16 0x06
 41+#define PARTITION_TYPE_OS2_HIDDEN_C_DRIVE 0x84
 42+
 43+/* returns a pointer to an array of 8 partinfo structs */
 44+struct partinfo* disk_init(IF_MD_NONVOID(int drive));
 45+struct partinfo* disk_partinfo(int partition);
 46+
 47+void disk_init_subsystem(void); /* Initialises mutexes */
 48+int disk_mount_all(void); /* returns the # of successful mounts */
 49+int disk_mount(int drive);
 50+int disk_unmount(int drive);
 51+
 52+/* The number of 512-byte sectors in a "logical" sector. Needed for ipod 5.5G */
 53+#ifdef MAX_LOG_SECTOR_SIZE
 54+extern int disk_sector_multiplier;
 55+#endif
 56+
 57+#endif