(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:
(no author) 2009-02-16 06:59:09 +00:00
parent 4c20bb519c
commit 575fbfb58c
5 changed files with 32 additions and 12 deletions

View File

@ -13,4 +13,14 @@
#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__

View File

@ -144,6 +144,8 @@ int nandNfsCtrl( int driveno, int opcode, void* pargs)
{
switch( opcode) {
case NFS_DEVCTL_GET_GEOMETRY: //formatまたはpartirionするときにRTFSが使うパラメータ
i_nandCalcSize();
*(u32*)pargs = sdmc_current_spec.memory_capacity;
return( 0);
case NFS_DEVCTL_FORMAT:

View File

@ -17,16 +17,6 @@
#include <brom/nand/nand.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{
u32 cmd;

View File

@ -439,6 +439,8 @@ void AreaUnpinFreeListHdr(AreaInfo *pAreaInfo);
#include "wfs_Client.h"
#endif
#include <drnand.h>
WFSKrnGlobals wkg ATTRIBUTE_ALIGN(512);
DirItr gDi;
@ -675,7 +677,11 @@ WFSResult WFSSrvInit(void *pWorkSpaceBuffer, u32 nWorkSpaceSize) {
//PathCacheTest();
WfsKrnAttachDetachCallback(true, 0, TEST_LOG2_SECTOR_SIZE, MAX_ALLOC_NUM_SECTORS, WFS_DEVTYPE_USB_MSC_20, 0);
#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, &sectors);
WfsKrnAttachDetachCallback(true, 0, TEST_LOG2_SECTOR_SIZE, sectors, WFS_DEVTYPE_USB_MSC_20, 0);
}
#elif _IOP
DeviceAttachDetachRegistCallback(WfsKrnAttachDetachCallback, 0);
#endif

View File

@ -37,6 +37,7 @@ WFSResult WFSDebugSetTitleId(WFSTitleId titleId);
OSThread my_tsk;
u64 my_stack[MY_STACK_SIZE / sizeof(u64)];
void MyThread( void* arg)
{
(void)osEnableInterrupts();
@ -78,11 +79,11 @@ void BromMain( void )
buddy_allocator_init( my_heap, 0x40000); //32KB
/*--- WFSライブラリ初期化 ---*/
osTPrintf( "ok\n");
WfsAlignedWorkBuf = (u16*)(MATH_ROUNDUP( (int)WfsWorkBuf, 512));
osTPrintf( "aligned buffer : 0x%x\n", (u32)WfsAlignedWorkBuf);
wfsResult = WFSInit( WfsAlignedWorkBuf, WFS_MIN_WORK_SPACE_SIZE);
osTPrintf( "WFSInit : %d\n", wfsResult);
/*--- フォーマット ---*/
WFSDebugSetTitleId( WFS_ROOT_ID);
wfsResult = WFSInitializeDevice( "msc01");
@ -103,6 +104,17 @@ void BromMain( void )
wfsResult = WFSCreateDirectory( (char*)path_str, WFS_PERM_FULL, 0);
osTPrintf( "WFSCreateDirectory : %d\n", wfsResult);
#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();
}