mirror of
https://github.com/vivier/EMILE.git
synced 2024-09-08 19:54:38 +00:00
rename map_partition_read and map_partition_write to map_read_sector and map_write_sector
This commit is contained in:
parent
b189dfbbed
commit
b0c25d723f
@ -14,5 +14,5 @@
|
|||||||
|
|
||||||
int map_bootblock_read(map_t* map, char* bootblock)
|
int map_bootblock_read(map_t* map, char* bootblock)
|
||||||
{
|
{
|
||||||
return map_partition_read(map, 0, BOOTBLOCK_SIZE, bootblock);
|
return map_read_sector(map, 0, bootblock, BOOTBLOCK_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -14,5 +14,5 @@
|
|||||||
|
|
||||||
int map_bootblock_write(map_t* map, char* bootblock)
|
int map_bootblock_write(map_t* map, char* bootblock)
|
||||||
{
|
{
|
||||||
return map_partition_write(map, 0, BOOTBLOCK_SIZE, bootblock);
|
return map_write_sector(map, 0, bootblock, BOOTBLOCK_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ int map_read_sector(map_t* map, off_t offset, char *buffer, size_t size)
|
|||||||
|
|
||||||
offset += read_long((u_int32_t*)&map->partition.PyPartStart);
|
offset += read_long((u_int32_t*)&map->partition.PyPartStart);
|
||||||
|
|
||||||
ret = map->device->read_sector(map->device->data, offset, sector, size);
|
ret = map->device->read_sector(map->device->data, offset, buffer, size);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ int map_write_sector(map_t* map, off_t offset, char *buffer, size_t size)
|
|||||||
|
|
||||||
offset += read_long((u_int32_t*)&map->partition.PyPartStart);
|
offset += read_long((u_int32_t*)&map->partition.PyPartStart);
|
||||||
|
|
||||||
ret = map->device->write_sector(map->device->data, offset, sector, size);
|
ret = map->device->write_sector(map->device->data, offset, buffer, size);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -154,8 +154,7 @@ static int get_driver(map_t *map, int partition, char* appledriver)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = map_partition_read(map, block * block_size, bootsize,
|
ret = map_read_sector(map, block * block_size, (char*)code, bootsize);
|
||||||
(char*)code);
|
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: cannot read driver (read())\n");
|
fprintf(stderr, "ERROR: cannot read driver (read())\n");
|
||||||
@ -260,8 +259,8 @@ static int put_driver(map_t *map, int partition, char* appledriver)
|
|||||||
|
|
||||||
/* write file in partition */
|
/* write file in partition */
|
||||||
|
|
||||||
ret = map_partition_write(map, block * block_size, st.st_size,
|
ret = map_write_sector(map, block * block_size, (char*)code,
|
||||||
(char*)code);
|
st.st_size);
|
||||||
free(code);
|
free(code);
|
||||||
|
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user