LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
disc_io.h
Go to the documentation of this file.
1/*
2 disc_io.h
3 Interface template for low level disc functions.
4
5 Copyright (c) 2006 Michael "Chishm" Chisholm
6 Based on code originally written by MightyMax
7
8 Redistribution and use in source and binary forms, with or without modification,
9 are permitted provided that the following conditions are met:
10
11 1. Redistributions of source code must retain the above copyright notice,
12 this list of conditions and the following disclaimer.
13 2. Redistributions in binary form must reproduce the above copyright notice,
14 this list of conditions and the following disclaimer in the documentation and/or
15 other materials provided with the distribution.
16 3. The name of the author may not be used to endorse or promote products derived
17 from this software without specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
20 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
22 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
30#ifndef OGC_DISC_IO_INCLUDE
31#define OGC_DISC_IO_INCLUDE
32
33#include <stdint.h>
34#include <xetypes.h>
35
36#define MAXDEVICES 16
37#define DISKIO_ERROR_NO_MEDIA -8
38
39#define FEATURE_MEDIUM_CANREAD 0x00000001
40#define FEATURE_MEDIUM_CANWRITE 0x00000002
41#define FEATURE_XENON_ATA 0x00000100
42#define FEATURE_XENON_ATAPI 0x00000200
43#define FEATURE_XENON_USB 0x00000400
44
46
47typedef bool (* FN_MEDIUM_STARTUP)(void) ;
48typedef bool (* FN_MEDIUM_ISINSERTED)(void) ;
49typedef bool (* FN_MEDIUM_READSECTORS)(sec_t sector, sec_t numSectors, void* buffer) ;
50typedef bool (* FN_MEDIUM_WRITESECTORS)(sec_t sector, sec_t numSectors, const void* buffer) ;
51typedef bool (* FN_MEDIUM_CLEARSTATUS)(void) ;
52typedef bool (* FN_MEDIUM_SHUTDOWN)(void) ;
53typedef s32 (* FN_MEDIUM_DEVSECTORS)(void) ;
54
56 unsigned long ioType ;
57 unsigned long features ;
65} ;
66
68
71
72#endif // define OGC_DISC_IO_INCLUDE
bool(* FN_MEDIUM_STARTUP)(void)
Definition: disc_io.h:47
bool(* FN_MEDIUM_CLEARSTATUS)(void)
Definition: disc_io.h:51
s32(* FN_MEDIUM_DEVSECTORS)(void)
Definition: disc_io.h:53
bool(* FN_MEDIUM_SHUTDOWN)(void)
Definition: disc_io.h:52
void unregister_disc_interface(DISC_INTERFACE *disc_io)
void register_disc_interface(DISC_INTERFACE *disc_io)
bool(* FN_MEDIUM_READSECTORS)(sec_t sector, sec_t numSectors, void *buffer)
Definition: disc_io.h:49
bool(* FN_MEDIUM_WRITESECTORS)(sec_t sector, sec_t numSectors, const void *buffer)
Definition: disc_io.h:50
uint32_t sec_t
Definition: disc_io.h:45
bool(* FN_MEDIUM_ISINSERTED)(void)
Definition: disc_io.h:48
u32 uint32_t
Definition: libfdt_env.h:11
FN_MEDIUM_ISINSERTED isInserted
Definition: disc_io.h:59
FN_MEDIUM_READSECTORS readSectors
Definition: disc_io.h:60
unsigned long ioType
Definition: disc_io.h:56
FN_MEDIUM_STARTUP startup
Definition: disc_io.h:58
FN_MEDIUM_DEVSECTORS sectors
Definition: disc_io.h:64
FN_MEDIUM_CLEARSTATUS clearStatus
Definition: disc_io.h:62
unsigned long features
Definition: disc_io.h:57
FN_MEDIUM_SHUTDOWN shutdown
Definition: disc_io.h:63
FN_MEDIUM_WRITESECTORS writeSectors
Definition: disc_io.h:61
int32_t s32
32bit signed integer
Definition: xetypes.h:19