mirror of
https://github.com/rvtr/ctr_firmware.git
synced 2025-10-31 07:51:08 -04:00
(shirait) nfsのフォーマットパラメータが誤っていたのを修正
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@295 b871894f-2f95-9b40-918c-086798483c85
This commit is contained in:
parent
4c20bb519c
commit
575fbfb58c
@ -13,4 +13,14 @@
|
|||||||
#define NFS_DEVCTL_POWER_LOSS 6
|
#define NFS_DEVCTL_POWER_LOSS 6
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
BOOL nandNfsIo( int driveno, u32 block, void* buffer, u16 count, BOOL reading);
|
||||||
|
int nandNfsCtrl( int driveno, int opcode, void* pargs);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif // __NFS_DRNAND_H__
|
#endif // __NFS_DRNAND_H__
|
||||||
|
|||||||
@ -144,6 +144,8 @@ int nandNfsCtrl( int driveno, int opcode, void* pargs)
|
|||||||
{
|
{
|
||||||
switch( opcode) {
|
switch( opcode) {
|
||||||
case NFS_DEVCTL_GET_GEOMETRY: //formatまたはpartirionするときにRTFSが使うパラメータ
|
case NFS_DEVCTL_GET_GEOMETRY: //formatまたはpartirionするときにRTFSが使うパラメータ
|
||||||
|
i_nandCalcSize();
|
||||||
|
*(u32*)pargs = sdmc_current_spec.memory_capacity;
|
||||||
return( 0);
|
return( 0);
|
||||||
|
|
||||||
case NFS_DEVCTL_FORMAT:
|
case NFS_DEVCTL_FORMAT:
|
||||||
|
|||||||
@ -17,16 +17,6 @@
|
|||||||
#include <brom/nand/nand.h>
|
#include <brom/nand/nand.h>
|
||||||
#include <drnand.h>
|
#include <drnand.h>
|
||||||
|
|
||||||
//TODO:他で宣言してincludeする
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
BOOL nandNfsIo( int driveno, u32 block, void* buffer, u16 count, BOOL reading);
|
|
||||||
int nandNfsCtrl( int driveno, int opcode, void* pargs);
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct{
|
typedef struct{
|
||||||
u32 cmd;
|
u32 cmd;
|
||||||
|
|||||||
@ -439,6 +439,8 @@ void AreaUnpinFreeListHdr(AreaInfo *pAreaInfo);
|
|||||||
#include "wfs_Client.h"
|
#include "wfs_Client.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <drnand.h>
|
||||||
|
|
||||||
WFSKrnGlobals wkg ATTRIBUTE_ALIGN(512);
|
WFSKrnGlobals wkg ATTRIBUTE_ALIGN(512);
|
||||||
|
|
||||||
DirItr gDi;
|
DirItr gDi;
|
||||||
@ -675,7 +677,11 @@ WFSResult WFSSrvInit(void *pWorkSpaceBuffer, u32 nWorkSpaceSize) {
|
|||||||
//PathCacheTest();
|
//PathCacheTest();
|
||||||
WfsKrnAttachDetachCallback(true, 0, TEST_LOG2_SECTOR_SIZE, MAX_ALLOC_NUM_SECTORS, WFS_DEVTYPE_USB_MSC_20, 0);
|
WfsKrnAttachDetachCallback(true, 0, TEST_LOG2_SECTOR_SIZE, MAX_ALLOC_NUM_SECTORS, WFS_DEVTYPE_USB_MSC_20, 0);
|
||||||
#elif _TWL
|
#elif _TWL
|
||||||
WfsKrnAttachDetachCallback(true, 0, TEST_LOG2_SECTOR_SIZE, MAX_ALLOC_NUM_SECTORS, WFS_DEVTYPE_USB_MSC_20, 0);
|
{
|
||||||
|
u32 sectors = 0;
|
||||||
|
nandNfsCtrl( 0, NFS_DEVCTL_GET_GEOMETRY, §ors);
|
||||||
|
WfsKrnAttachDetachCallback(true, 0, TEST_LOG2_SECTOR_SIZE, sectors, WFS_DEVTYPE_USB_MSC_20, 0);
|
||||||
|
}
|
||||||
#elif _IOP
|
#elif _IOP
|
||||||
DeviceAttachDetachRegistCallback(WfsKrnAttachDetachCallback, 0);
|
DeviceAttachDetachRegistCallback(WfsKrnAttachDetachCallback, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -37,6 +37,7 @@ WFSResult WFSDebugSetTitleId(WFSTitleId titleId);
|
|||||||
OSThread my_tsk;
|
OSThread my_tsk;
|
||||||
u64 my_stack[MY_STACK_SIZE / sizeof(u64)];
|
u64 my_stack[MY_STACK_SIZE / sizeof(u64)];
|
||||||
|
|
||||||
|
|
||||||
void MyThread( void* arg)
|
void MyThread( void* arg)
|
||||||
{
|
{
|
||||||
(void)osEnableInterrupts();
|
(void)osEnableInterrupts();
|
||||||
@ -78,11 +79,11 @@ void BromMain( void )
|
|||||||
buddy_allocator_init( my_heap, 0x40000); //32KB
|
buddy_allocator_init( my_heap, 0x40000); //32KB
|
||||||
|
|
||||||
/*--- WFSライブラリ初期化 ---*/
|
/*--- WFSライブラリ初期化 ---*/
|
||||||
osTPrintf( "ok\n");
|
|
||||||
WfsAlignedWorkBuf = (u16*)(MATH_ROUNDUP( (int)WfsWorkBuf, 512));
|
WfsAlignedWorkBuf = (u16*)(MATH_ROUNDUP( (int)WfsWorkBuf, 512));
|
||||||
osTPrintf( "aligned buffer : 0x%x\n", (u32)WfsAlignedWorkBuf);
|
osTPrintf( "aligned buffer : 0x%x\n", (u32)WfsAlignedWorkBuf);
|
||||||
wfsResult = WFSInit( WfsAlignedWorkBuf, WFS_MIN_WORK_SPACE_SIZE);
|
wfsResult = WFSInit( WfsAlignedWorkBuf, WFS_MIN_WORK_SPACE_SIZE);
|
||||||
osTPrintf( "WFSInit : %d\n", wfsResult);
|
osTPrintf( "WFSInit : %d\n", wfsResult);
|
||||||
|
|
||||||
/*--- フォーマット ---*/
|
/*--- フォーマット ---*/
|
||||||
WFSDebugSetTitleId( WFS_ROOT_ID);
|
WFSDebugSetTitleId( WFS_ROOT_ID);
|
||||||
wfsResult = WFSInitializeDevice( "msc01");
|
wfsResult = WFSInitializeDevice( "msc01");
|
||||||
@ -103,6 +104,17 @@ void BromMain( void )
|
|||||||
wfsResult = WFSCreateDirectory( (char*)path_str, WFS_PERM_FULL, 0);
|
wfsResult = WFSCreateDirectory( (char*)path_str, WFS_PERM_FULL, 0);
|
||||||
osTPrintf( "WFSCreateDirectory : %d\n", wfsResult);
|
osTPrintf( "WFSCreateDirectory : %d\n", wfsResult);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*--- 空きサイズ取得 ---*/
|
||||||
|
{
|
||||||
|
u32 freesize[2];
|
||||||
|
freesize[1] = freesize[0] = 0;
|
||||||
|
osSPrintf( (char*)path_str, "/vol/%s/", wfsVolumeId);
|
||||||
|
WFSGetFreeSpaceSize( path_str, &freesize);
|
||||||
|
osTPrintf( "WFSGetFreeSpaceSize : 0x%x%x\n", freesize[1], freesize[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
WFSExit();
|
WFSExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user