core, pxe: Don't push on one stack and pop from the other in pxenv
[syslinux.git] / core / fs / diskio.c
blobe9a4c1da55d3a11fdd5738603609d5f3ce25aeed
1 #include <dprintf.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include <stdbool.h>
5 #include <klibc/compiler.h>
6 #include <core.h>
7 #include <fs.h>
8 #include <disk.h>
9 #include <ilog2.h>
10 #include <minmax.h>
12 #include <syslinux/firmware.h>
14 void getoneblk(struct disk *disk, char *buf, block_t block, int block_size)
16 int sec_per_block = block_size / disk->sector_size;
18 disk->rdwr_sectors(disk, buf, block * sec_per_block, sec_per_block, 0);
22 * Initialize the device structure.
24 struct device * device_init(void *args)
26 static struct device dev;
28 dev.disk = firmware->disk_init(args);
29 dev.cache_size = 128*1024;
30 dev.cache_data = malloc(dev.cache_size);
31 dev.cache_init = 0; /* Explicitly set cache as uninitialized */
33 return &dev;