MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / ide_set_sector

Function ide_set_sector

tinyemu/ide.c:352–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352static void ide_set_sector(IDEState *s, int64_t sector_num)
353{
354 unsigned int cyl, r;
355 if (s->select & 0x40) {
356 s->select = (s->select & 0xf0) | ((sector_num >> 24) & 0x0f);
357 s->hcyl = (sector_num >> 16) & 0xff;
358 s->lcyl = (sector_num >> 8) & 0xff;
359 s->sector = sector_num & 0xff;
360 } else {
361 cyl = sector_num / (s->heads * s->sectors);
362 r = sector_num % (s->heads * s->sectors);
363 s->hcyl = (cyl >> 8) & 0xff;
364 s->lcyl = cyl & 0xff;
365 s->select = (s->select & 0xf0) | ((r / s->sectors) & 0x0f);
366 s->sector = (r % s->sectors) + 1;
367 }
368}
369
370static void ide_sector_read(IDEState *s)
371{

Callers 3

ide_sector_read_cbFunction · 0.85
ide_sector_write_cb2Function · 0.85
ide_exec_cmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected