Subversion Repositories Kolibri OS

Rev

Rev 4522 | Rev 9056 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1.  
  2. ; Macroinstructions for making import section
  3. ; Based on import32.inc from FASM, with small modifications
  4. ; and list of actual kernel exports.
  5.  
  6. macro library [name,string]
  7.  { common
  8.     import.data:
  9.    forward
  10.     local _label
  11.     if defined name#.redundant
  12.      if ~ name#.redundant
  13.       dd 0,0,0,RVA _label,RVA name#.address
  14.      end if
  15.     end if
  16.     name#.referred = 1
  17.    common
  18.     dd 0,0,0,0,0
  19.    forward
  20.     if defined name#.redundant
  21.      if ~ name#.redundant
  22.       _label db string,0
  23.      end if
  24.     end if }
  25.  
  26. macro import name,[label]
  27.  { common
  28.     rb (- rva $) and 3
  29.     if defined name#.referred
  30.      name#.address:
  31.    forward
  32.      if used label
  33.        local _label
  34.        label dd RVA _label
  35.        label#._pe_import = 1
  36.      end if
  37.    common
  38.      if $ > name#.address
  39.       name#.redundant = 0
  40.       dw 0
  41.      else
  42.       name#.redundant = 1
  43.      end if
  44.    forward
  45.      if used label
  46.      _label dw 0
  47.             db `label
  48.      end if
  49.    common
  50.      db 0
  51.     end if }
  52.  
  53. align 4
  54. data import
  55. library core,'core.dll'
  56. import core,\
  57.               RegService,\
  58.               GetService,\
  59.               ServiceHandler,\
  60.               AttachIntHandler,\
  61.               GetIntHandler,\
  62.               FpuSave,\
  63.               FpuRestore,\
  64.               ReservePortArea,\
  65.               Boot_Log,\
  66. \
  67.           MutexInit,\
  68.           MutexLock,\
  69.           MutexUnlock,\
  70. \
  71.               PciApi,\
  72.               PciRead32,\
  73.               PciRead16,\
  74.               PciRead8,\
  75.               PciWrite8,\
  76.               PciWrite16,\
  77.               PciWrite32,\
  78. \
  79.               AllocPage,\
  80.               AllocPages,\
  81.               FreePage,\
  82.               MapPage,\
  83.               MapSpace,\
  84.               MapIoMem,\
  85.               GetPgAddr,\
  86.               GetPhysAddr,\
  87.               CommitPages,\
  88.               ReleasePages,\
  89. \
  90.               AllocKernelSpace,\
  91.               FreeKernelSpace,\
  92.               KernelAlloc,\
  93.               KernelFree,\
  94.               UserAlloc,\
  95.               UserFree,\
  96.               Kmalloc,\
  97.               Kfree,\
  98.               CreateRingBuffer,\
  99.               AllocDMA24,\
  100. \
  101.               GetPid,\
  102.               CreateThread,\
  103.               CreateObject,\
  104.               DestroyObject,\
  105.               CreateEvent,\
  106.               RaiseEvent,\
  107.               WaitEvent,\
  108.               DestroyEvent,\
  109.               ClearEvent,\
  110. \
  111.               LoadCursor,\
  112.               SelectHwCursor,\
  113.               SetHwCursor,\
  114.               HwCursorRestore,\
  115.               HwCursorCreate,\
  116. \
  117.               SysMsgBoardStr,\
  118.               SysMsgBoard,\
  119.               GetCurrentTask,\
  120.               LoadFile,\
  121.               SendEvent,\
  122.               SetMouseData,\
  123.               SetKeyboardData,\
  124.               RegKeyboard,\
  125.               DelKeyboard,\
  126.               Sleep,\
  127.               GetTimerTicks,\
  128. \
  129.               strncat,\
  130.               strncpy,\
  131.               strncmp,\
  132.               strnlen,\
  133.               strchr,\
  134.               strrchr,\
  135. \
  136.               LFBAddress,\
  137.               GetDisplay,\
  138.               SetScreen,\
  139. \
  140.               RegUSBDriver,\
  141.               USBOpenPipe,\
  142.               USBNormalTransferAsync,\
  143.               USBControlTransferAsync,\
  144.               USBGetParam,\
  145.               USBHCFunc,\
  146. \
  147.               DiskAdd,\
  148.               DiskMediaChanged,\
  149.               DiskDel,\
  150. \
  151.               TimerHS,\
  152.               CancelTimerHS,\
  153. \
  154.               NetRegDev,\
  155.               NetUnRegDev,\
  156.               NetPtrToNum,\
  157.               NetLinkChanged,\
  158.               Eth_input,\
  159.               IPv4_input,\
  160. \
  161.               GetPCIList
  162. end data
  163.