1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     fs_IpcFileSystem.h
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 26217 $
14  *---------------------------------------------------------------------------*/
15 
16 //
17 // このファイルを編集しないでください。
18 // このファイルは自動生成されます。
19 //
20 
21 #ifndef NN_FS_FS_IPCFILESYSTEM_H_
22 #define NN_FS_FS_IPCFILESYSTEM_H_
23 
24 #include <nn/Handle.h>
25 #include <nn/Result.h>
26 #include <nn/types.h>
27 #include <nn/fs/fs_File.h>
28 #include <nn/fs/CTR/fs_Types.h>
29 #include <nn/fs/fs_Parameters.h>
30 
31 
32 
33 namespace nn {
34 namespace fs {
35 namespace ipc {
36 
37     class FileSystem
38     {
39     public:
40         enum Tag
41         {
42             TAG_IPC_ERROR,
43             TAG_INITIALIZE,
44             TAG_OPEN_FILE,
45             TAG_OPEN_FILE_DIRECTLY,
46             TAG_DELETE_FILE,
47             TAG_RENAME_FILE,
48             TAG_DELETE_DIRECTORY,
49             TAG_DELETE_DIRECTORY_RECURSIVELY,
50             TAG_CREATE_DIRECTORY,
51             TAG_RENAME_DIRECTORY,
52             TAG_OPEN_DIRECTORY,
53             TAG_OPEN_ARCHIVE,
54             TAG_CONTROL_ARCHIVE,
55             TAG_CLOSE_ARCHIVE,
56             TAG_FORMAT_SAVE_DATA,
57             TAG_GET_FREE_BYTES,
58             TAG_SET_NAND_FATAL_ERROR,
59             TAG_ENABLE_NOTIFICATION_NAND_FATAL_ERROR,
60             TAG_DISABLE_NOTIFICATION_NAND_FATAL_ERROR,
61             TAG_ACTIVATE_CARD_DEVICE,
62             TAG_DEACTIVATE_CARD_DEVICE,
63             TAG_GET_CARD_TYPE,
64             TAG_ACTIVATE_SDMC_DEVICE,
65             TAG_DEACTIVATE_SDMC_DEVICE,
66             TAG_GET_SDMC_ARCHIVE_RESOURCE,
67             TAG_GET_NAND_ARCHIVE_RESOURCE,
68             TAG_GET_SDMC_FATFS_ERROR,
69             TAG_IS_SDMC_DETECTED,
70             TAG_IS_SDMC_WRITABLE,
71             TAG_GET_SDMC_CID,
72             TAG_GET_NAND_CID,
73             TAG_GET_SDMC_SPEED_INFO,
74             TAG_GET_NAND_SPEED_INFO,
75             TAG_GET_SDMC_LOG,
76             TAG_GET_NAND_LOG,
77             TAG_CLEAR_SDMC_LOG,
78             TAG_CLEAR_NAND_LOG,
79             TAG_CARD_SLOT_IS_INSERTED,
80             TAG_CARD_SLOT_POWER_ON,
81             TAG_CARD_SLOT_POWER_OFF,
82             TAG_CARD_SLOT_GET_CARD_IF_POWER_STATUS,
83             TAG_CARD_NOR_DIRECT_COMMAND,
84             TAG_CARD_NOR_DIRECT_COMMAND_WITH_ADDRESS,
85             TAG_CARD_NOR_DIRECT_READ,
86             TAG_CARD_NOR_DIRECT_READ_WITH_ADDRESS,
87             TAG_CARD_NOR_DIRECT_WRITE,
88             TAG_CARD_NOR_DIRECT_WRITE_WITH_ADDRESS,
89             TAG_CARD_NOR_DIRECT_READ_4X_IO,
90             TAG_CARD_NOR_DIRECT_CPU_WRITE_WITHOUT_VERIFY,
91             TAG_CARD_NOR_DIRECT_SECTOR_ERASE_WITHOUT_VERIFY,
92             TAG_GET_PRODUCT_INFO,
93             TAG_GET_PROGRAM_LAUNCH_INFO,
94             TAG_FORMAT_EXT_SAVE_DATA,
95             TAG_FORMAT_SHARED_EXT_SAVE_DATA,
96             TAG_READ_EXT_SAVE_DATA_ICON,
97             TAG_ENUMERATE_EXT_SAVE_DATA,
98             TAG_ENUMERATE_SHARED_EXT_SAVE_DATA,
99             TAG_DELETE_EXT_SAVE_DATA,
100             TAG_DELETE_SHARED_EXT_SAVE_DATA,
101             TAG_SET_CARD_SPI_BAUD_RATE,
102             TAG_SET_CARD_SPI_BUS_MODE,
103             TAG_IPC_END
104         };
105 
106     private:
107         Handle m_Session;
108 
109     public:
FileSystem(Handle session)110         FileSystem(Handle session) : m_Session(session) {}
111 
112     public:
113         nn::Result Initialize();
114         nn::Result OpenFile( nn::Handle* pOut, nn::fs::Transaction transaction, bit64 archiveHandle, bit32 pathType, const bit8 path[], size_t pathLength, bit32 mode, nn::fs::Attributes attributes );
115         nn::Result OpenFileDirectly( nn::Handle* pOut, nn::fs::Transaction transaction, bit32 archiveType, bit32 archivePathType, const bit8 newPath[], size_t archivePathLength, bit32 pathType, const bit8 path[], size_t pathLength, bit32 mode, nn::fs::Attributes attributes );
116         nn::Result DeleteFile( nn::fs::Transaction transaction, bit64 archiveHandle, bit32 pathType, const bit8 path[], size_t pathLength );
117         nn::Result RenameFile( nn::fs::Transaction transaction, bit64 currentArchiveHandle, bit32 currentPathType, const bit8 currentPath[], size_t currentPathLength, bit64 newArchiveHandle, bit32 newPathType, const bit8 newPath[], size_t newPathLength );
118         nn::Result DeleteDirectory( nn::fs::Transaction transaction, bit64 archiveHandle, bit32 pathType, const bit8 path[], size_t pathLength );
119         nn::Result DeleteDirectoryRecursively( nn::fs::Transaction transaction, bit64 archiveHandle, bit32 pathType, const bit8 path[], size_t pathLength );
120         nn::Result CreateDirectory( nn::fs::Transaction transaction, bit64 archiveHandle, bit32 pathType, const bit8 path[], size_t pathLength, nn::fs::Attributes attributes );
121         nn::Result RenameDirectory( nn::fs::Transaction transaction, bit64 currentArchiveHandle, bit32 currentPathType, const bit8 currentPath[], size_t currentPathLength, bit64 newArchiveHandle, bit32 newPathType, const bit8 newPath[], size_t newPathLength );
122         nn::Result OpenDirectory( nn::Handle* pOut, bit64 archiveHandle, bit32 pathType, const bit8 path[], size_t pathLength );
123         nn::Result OpenArchive( bit64* archiveHandle, bit32 archiveType, bit32 pathType, const bit8 path[], size_t pathLength );
124         nn::Result ControlArchive( bit64 archiveHandle, bit32 pathType, const bit8 path[], size_t pathLength );
125         nn::Result CloseArchive( bit64 archiveHandle );
126         nn::Result FormatSaveData( u32 sizeBlock, u32 countDirectoryEntry, u32 countFileEntry, u32 countDirectoryEntryBucket, u32 countFileEntryBucket );
127         nn::Result GetFreeBytes( s64* freeBytes, bit64 archiveHandle );
128         nn::Result SetNandFatalError();
129         nn::Result EnableNotificationNandFatalError();
130         nn::Result DisableNotificationNandFatalError();
131         nn::Result ActivateCardDevice();
132         nn::Result DeactivateCardDevice();
133         nn::Result GetCardType( nn::fs::CardType* pOut );
134         nn::Result ActivateSdmcDevice();
135         nn::Result DeactivateSdmcDevice();
136         nn::Result GetSdmcArchiveResource( nn::fs::ArchiveResource* pOut );
137         nn::Result GetNandArchiveResource( nn::fs::ArchiveResource* pOut );
138         nn::Result GetSdmcFatfsError( s32* pOut );
139         nn::Result IsSdmcDetected( bool* pOut );
140         nn::Result IsSdmcWritable( bool* pOut );
141         nn::Result GetSdmcCid( void* pBuffer, size_t size );
142         nn::Result GetNandCid( void* pBuffer, size_t size );
143         nn::Result GetSdmcSpeedInfo( nn::fs::SdmcSpeedInfo* pOut );
144         nn::Result GetNandSpeedInfo( nn::fs::NandSpeedInfo* pOut );
145         nn::Result GetSdmcLog( void* pBuffer, size_t size );
146         nn::Result GetNandLog( void* pBuffer, size_t size );
147         nn::Result ClearSdmcLog();
148         nn::Result ClearNandLog();
149         nn::Result CardSlotIsInserted( bool* pOut );
150         nn::Result CardSlotPowerOn( u8* pOut );
151         nn::Result CardSlotPowerOff( u8* pOut );
152         nn::Result CardSlotGetCardIFPowerStatus( u8* pOut );
153         nn::Result CardNorDirectCommand( u8 command );
154         nn::Result CardNorDirectCommandWithAddress( u8 command, u32 address );
155         nn::Result CardNorDirectRead( u8 command, u32 pBuffer[], size_t size );
156         nn::Result CardNorDirectReadWithAddress( u8 command, u32 address, u32 pBuffer[], size_t size );
157         nn::Result CardNorDirectWrite( u8 command, const u32 pBuffer[], size_t size );
158         nn::Result CardNorDirectWriteWithAddress( u8 command, u32 address, const u32 pBuffer[], size_t size );
159         nn::Result CardNorDirectRead_4xIO( u8 command, u32 address, u32 pBuffer[], size_t size );
160         nn::Result CardNorDirectCpuWriteWithoutVerify( const u32 pBuffer[], u32 address, size_t size );
161         nn::Result CardNorDirectSectorEraseWithoutVerify( u32 address );
162         nn::Result GetProductInfo( nn::ProductInfo* pOut, bit32 processId );
163         nn::Result GetProgramLaunchInfo( nn::fs::ProgramLaunchInfo* pOut, bit32 processId );
164         nn::Result FormatExtSaveData( nn::fs::MediaType mediaType, bit64 extSaveDataId, const void* pBuffer, size_t size, u32 entryDirectory, u32 entryFile );
165         nn::Result FormatSharedExtSaveData( nn::fs::MediaType mediaType, bit64 extSaveDataId, u32 entryDirectory, u32 entryFile, size_t limitSize );
166         nn::Result ReadExtSaveDataIcon( s32* pOut, nn::fs::MediaType mediaType, bit64 extSaveDataId, void* pBuffer, size_t size );
167         nn::Result EnumerateExtSaveData( s32* pNumId, bit64 pStorageId[], size_t numBuffer, nn::fs::MediaType mediaType );
168         nn::Result EnumerateSharedExtSaveData( s32* pNumId, bit64 pStorageId[], size_t numBuffer, nn::fs::MediaType mediaType );
169         nn::Result DeleteExtSaveData( nn::fs::MediaType mediaType, bit64 extSaveDataId );
170         nn::Result DeleteSharedExtSaveData( nn::fs::MediaType mediaType, bit32 extSaveDataId );
171         nn::Result SetCardSpiBaudRate( nn::fs::CardSpiBaudRate baudRate );
172         nn::Result SetCardSpiBusMode( nn::fs::CardSpiBusMode busMode );
173     };
174 
175 } // end of namespace ipc
176 } // end of namespace fs
177 } // end of namespace nn
178 
179 
180 
181 #endif  // ifndef NN_FS_FS_IPCFILESYSTEM_H_
182