Ignore:
Timestamp:
May 8, 2013, 5:10:33 PM (12 years ago)
Author:
David Azarewicz
Message:

Fixed up timer functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/ata.c

    r156 r157  
    443443int check_lvm(IORBH _far *iorb, ULONG sector)
    444444{
    445   ADD_WORKSPACE _far *aws = add_workspace(iorb);
     445  DLA_Table_Sector *pDLA = (DLA_Table_Sector*)add_workspace(iorb)->buf;
    446446  AD_INFO *ai = ad_infos + iorb_unit_adapter(iorb);
    447447  GEOMETRY _far *geometry = ((IORB_GEOMETRY _far *) iorb)->pGeometry;
    448   PDLA_Table_Sector pDLA;
    449448  int p = iorb_unit_port(iorb);
    450449  int rc;
     
    453452         AP_SECTOR_28, (u32) sector-1,
    454453         AP_COUNT, (u16) 1,
    455          AP_VADDR, (void _far *) aws->buf, 512,
     454         AP_VADDR, (void _far *) pDLA, 512,
    456455         AP_DEVICE, 0x40,
    457456         AP_END);
    458457  if (rc) return 0;
    459458
    460   pDLA = (PDLA_Table_Sector)aws->buf;
    461459  ddphex(pDLA, sizeof(DLA_Table_Sector), "DLA sector %d:\n", sector-1);
    462460
    463461  if ((pDLA->DLA_Signature1 == DLA_TABLE_SIGNATURE1) && (pDLA->DLA_Signature2 == DLA_TABLE_SIGNATURE2)) {
    464     ddprintf("is_lvm_geometry found at sector %d\n", sector);
     462    ddprintf("is_lvm_geometry found at sector %d\n", sector-1);
    465463    geometry->TotalCylinders = pDLA->Cylinders;
    466464    geometry->NumHeads = pDLA->Heads_Per_Cylinder;
    467465    geometry->SectorsPerTrack = pDLA->Sectors_Per_Track;
     466    geometry->TotalSectors = pDLA->Cylinders * pDLA->Heads_Per_Cylinder * pDLA->Sectors_Per_Track;
    468467    return 1;
    469468  }
     
    605604  if (is_lvm_geometry(iorb)) Method = "LVM";
    606605
    607   if (debug) {
    608     printf("Drive geometry: %d cylinders, %d heads, %d sectors per track (%ldMB) (%s)\n",
    609         (u16) geometry->TotalCylinders, (u16) geometry->NumHeads, (u16) geometry->SectorsPerTrack,
    610         (u32) (geometry->TotalSectors / 2048), Method);
    611   }
     606  dprintf("Drive geometry: %ld cylinders, %d heads, %d sectors per track (%ldMB) (%s)\n",
     607      (u32) geometry->TotalCylinders, (u16) geometry->NumHeads, (u16) geometry->SectorsPerTrack,
     608      (u32) (geometry->TotalSectors / 2048), Method);
    612609
    613610  /* tell interrupt handler that this IORB is complete */
Note: See TracChangeset for help on using the changeset viewer.