Lines Matching refs:sd
57 struct sdcard_device *sd; in rt_sdcard_read() local
63 sd = SDCARD_DEVICE(device); in rt_sdcard_read()
64 fseek(sd->file, position * SECTOR_SIZE, SEEK_SET); in rt_sdcard_read()
66 result = fread(buffer, size * SECTOR_SIZE, 1, sd->file); in rt_sdcard_read()
85 struct sdcard_device *sd; in rt_sdcard_write() local
91 sd = SDCARD_DEVICE(device); in rt_sdcard_write()
92 fseek(sd->file, position * SECTOR_SIZE, SEEK_SET); in rt_sdcard_write()
94 result = fwrite(buffer, size * SECTOR_SIZE, 1, sd->file); in rt_sdcard_write()
109 struct sdcard_device *sd; in rt_sdcard_control() local
114 sd = SDCARD_DEVICE(dev); in rt_sdcard_control()
126 fseek(sd->file, 0, SEEK_END); in rt_sdcard_control()
127 size = ftell(sd->file); in rt_sdcard_control()
137 struct sdcard_device *sd; in rt_hw_sdcard_init() local
140 sd = &_sdcard; in rt_hw_sdcard_init()
141 device = &(sd->parent); in rt_hw_sdcard_init()
151 sd->file = fopen(SDCARD_SIM, "rb+"); in rt_hw_sdcard_init()
152 if (sd->file == NULL) in rt_hw_sdcard_init()
155 sd->file = fopen(SDCARD_SIM, "wb+"); in rt_hw_sdcard_init()
157 fseek(sd->file, 0, SEEK_END); in rt_hw_sdcard_init()
158 size = ftell(sd->file); in rt_hw_sdcard_init()
160 fseek(sd->file, 0, SEEK_SET); in rt_hw_sdcard_init()
174 fseek(sd->file, 0, SEEK_SET); in rt_hw_sdcard_init()
177 fwrite(ptr, 1024 * 1024, 1, sd->file); in rt_hw_sdcard_init()
182 fseek(sd->file, 0, SEEK_SET); in rt_hw_sdcard_init()