ソースを参照

usbstorage 1.5.1: lock system during block transfers

tags/1.5.1
mntmn 1年前
コミット
0cf0bfb37f
1個のファイルの変更7行の追加1行の削除
  1. +7
    -1
      usb-storage/mntsd_cmd.c

+ 7
- 1
usb-storage/mntsd_cmd.c ファイルの表示

@@ -35,7 +35,8 @@ uint16 sdcmd_read_blocks(void* registers, uint8* data, uint32 block, uint32 len)
uint32 offset=0;
uint32 num_blocks=1;
volatile struct MNTUSBSRegs* regs = (volatile struct MNTUSBSRegs*)registers;

Forbid();
while (i<len) {
offset = i<<SD_SECTOR_SHIFT;

@@ -60,6 +61,8 @@ uint16 sdcmd_read_blocks(void* registers, uint8* data, uint32 block, uint32 len)

i += num_blocks;
}
Permit();
return 0;
}

@@ -70,6 +73,7 @@ uint16 sdcmd_write_blocks(void* registers, uint8* data, uint32 block, uint32 len
uint32 num_blocks=1;
struct MNTUSBSRegs* regs = (struct MNTUSBSRegs*)registers;
Forbid();
while (i<len) {
offset = i<<SD_SECTOR_SHIFT;
@@ -94,6 +98,8 @@ uint16 sdcmd_write_blocks(void* registers, uint8* data, uint32 block, uint32 len
i += num_blocks;
}
Permit();
return 0;
}



読み込み中…
キャンセル
保存