Changeset 153 for trunk


Ignore:
Timestamp:
Apr 3, 2013, 11:13:13 PM (12 years ago)
Author:
David Azarewicz
Message:

Makefile updates
Debug output improvements
Support for ACPI suspend/resume added

Location:
trunk/src/os2ahci
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/Makefile

    r152 r153  
    4646VENDOR=$(%VENDOR)
    4747!else
    48 VENDOR=Mensys BV
     48VENDOR=Unknown
    4949!endif
    5050
     
    7979
    8080%PATH=..\..\tools;$(WATCOM)\BINP;$(WATCOM)\BINW;
    81 AS         = wasm
    82 CC         = wcc
    83 MAPSYM     = $(DDK)\base\tools\mapsym.exe
     81AS     = wasm
     82CC     = wcc
     83MAPSYM = $(DDK)\base\tools\mapsym.exe
    8484
    8585!ifdef __LOADDLL__
     
    8989
    9090AFLAGS = -q
    91 #CFLAGS = -ei -5 -d3 -hc -bt=os2 -ms -zu -w3 -wcd=138 -wcd=300 -ecc -zp1 -q -s -zgp -zfp -oi
    9291# In order to build the SMP safe version you must have the updated devhelp.h and define OS2AHCI_SMP.
    93 CFLAGS = -ei -5 -d0 -bt=os2 -ms -zu -w=0 -ecc -zp=1 -q -s -zgp -zfp -oi -DOS2AHCI_SMP
    94 CFLAGS_DEBUG = -ei -5 -d3 -hc -bt=os2 -ms -zu -ecc -zp=1 -q -s -zgp -zfp -od
     92CFLAGS = -ei -6 -d0 -bt=os2 -ms -zu -wx -ecc -zp=1 -q -s -zgp -zfp -oi -DOS2AHCI_SMP
     93CFLAGS_DEBUG = -ei -6 -d3 -hc -bt=os2 -ms -zu -ecc -zp=1 -q -s -zgp -zfp -od
    9594
    9695###############################################################################
     
    150149    @AddToFile $^@,$#define BLD_MONTH,DATEMONTH
    151150    @AddToFile $^@,$#define BLD_DAY,DATEDAY
    152         @AddToFile.cmd $^@,$#define BLDLEVEL,BLDLEVEL2,$(VENDOR),$(BLD_MAJOR).$(BLD_MINOR),AHCI Driver (c) Mensys BV 2013
     151        @AddToFile $^@,$#define BLDLEVEL,BLDLEVEL2,$(VENDOR),$(BLD_MAJOR).$(BLD_MINOR),AHCI Driver (c) Mensys BV 2013
    153152
    154153.asm.obj: .autodepend
  • trunk/src/os2ahci/README

    r148 r153  
    6262
    6363 - IBM OS/2 DDK version 9.23 or later (see ddk\base\h\version.mak)
    64    (Used for include files and qgrep)
     64   and that has been updated for SMP systems. (Used for include files)
    6565 - Open Watcom C/C++ package
    6666   (available from: http://www.openwatcom.org/index.php/Downloads)
  • trunk/src/os2ahci/apm.c

    r87 r153  
    105105  int d;
    106106
     107  if (suspended) return;
    107108  dprintf("apm_suspend()\n");
    108109
     
    140141  }
    141142
     143  suspended = 1;
    142144  dprintf("apm_suspend() finished\n");
    143145}
     
    151153  int a;
    152154
     155  if (!suspended) return;
    153156  dprintf("apm_resume()\n");
    154157
     
    172175  }
    173176
     177  suspended = 0;
    174178  dprintf("apm_resume() finished\n");
    175179}
  • trunk/src/os2ahci/ata.c

    r136 r153  
    10651065                 AP_END);
    10661066  }
    1067  
     1067
    10681068  return(rc);
    10691069}
  • trunk/src/os2ahci/init.asm

    r144 r153  
    4040                db      "OS2AHCI$"              ; name of character device
    4141                dq      0                       ; 8 reserved bytes
    42                 dd      DEV_IOCTL2 + DEV_ADAPTER_DD + DEV_INITCOMPLETE + 20h ; ADD flags
     42                dd      DEV_IOCTL2 + DEV_ADAPTER_DD + DEV_INITCOMPLETE + DEV_SAVERESTORE ; ADD flags
    4343                dw      0
    4444
     45; This is here to support old SMART tools. This is a really bad thing to do as it will
     46; cause problems in the future. The SMART tools should be fixed instead.
    4547_legacy_hdr     dd      -1                      ; no headers after this one
    4648                dw      DEVLEV_3 + DEV_CHAR_DEV ; flags for ADD drivers
     
    5153                dd      0
    5254                dw      0
     55
    5356DEVHDR          ENDS
    5457
  • trunk/src/os2ahci/libc.c

    r148 r153  
    375375  vsprintf(buf, fmt, va);
    376376
    377   if (debug && com_base != 0) {
    378     /* print the same message to COM1 as well */
     377  if (debug) {
     378    /* print the same message to COM1/trace as well */
    379379    printf("%s", buf);
    380380  }
  • trunk/src/os2ahci/os2ahci.c

    r152 r153  
    121121u16             ad_ignore;         /* bitmap with adapter indexes to ignore */
    122122int             init_complete;     /* if != 0, initialization has completed */
     123int             suspended;
    123124
    124125/* apapter/port-specific options saved when parsing the command line */
     
    163164  case CMDINPUT:
    164165    rc = char_dev_input((RP_RWV _far *) req);
     166    break;
     167
     168  case CMDSaveRestore:
     169    rc = sr_drv(((RPSAVERESTORE _far *) req)->FuncCode);
    165170    break;
    166171
     
    203208  }
    204209  init_drv_called = 1;
     210  suspended = 0;
    205211
    206212  /* set device helper entry point */
     
    373379    trace_init();
    374380  }
     381  dprintf("BldLevel: %s\n", BldLevel);
     382  dprintf("CmdLine: %Fs\n", cmd_line);
    375383
    376384  /* scan PCI bus for supported devices */
     
    518526
    519527  apm_suspend();
     528  return(STDON);
     529}
     530
     531/******************************************************************************
     532 * Device driver suspend/resume handler. This handler is called when ACPI is
     533 * executing a suspend or resume.
     534 */
     535USHORT sr_drv(int func)
     536{
     537  dprintf("sr_drv(%d) called\n", func);
     538
     539  if (func) apm_resume();
     540  else apm_suspend();
     541
    520542  return(STDON);
    521543}
  • trunk/src/os2ahci/os2ahci.h

    r150 r153  
    404404extern USHORT  char_dev_input         (RP_RWV _far *rwrb);
    405405extern USHORT  exit_drv               (int func);
     406extern USHORT  sr_drv                 (int func);
    406407extern void _cdecl _far _loadds add_entry    (IORBH _far *iorb);
    407408extern void    trigger_engine         (void);
     
    557558extern u16           ad_ignore;     /* bitmap with adapters to be ignored */
    558559extern int           init_complete; /* if != 0, initialization has completed */
     560extern int           suspended;     /* indicates if the driver is suspended */
    559561
    560562extern u16           com_base;      /* debug COM port base address */
  • trunk/src/os2ahci/pci.c

    r148 r153  
    610610
    611611  /* found a supported AHCI device */
    612   ciiprintf("found AHCI device: %s %s (%04x:%04x)\n"
    613             " class:0x%06lx bus:%d devfunc:0x%02x\n",
     612  ciiprintf("found AHCI device: %s %s (%04x:%04x) class:0x%06lx bus:%d devfunc:0x%02x\n",
    614613            vendor_from_id(vendor), device_from_id(device),
    615614            vendor, device,
  • trunk/src/os2ahci/trace.c

    r148 r153  
    169169u16 trace_read(u8 _far *buf, u16 cb_buf)
    170170{
    171   u16 cb_avail;
    172171  u16 cb_read;
    173172
Note: See TracChangeset for help on using the changeset viewer.