v86 0.3.6 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/Readme.md +17 -6
  2. package/bios/seabios/.config +113 -0
  3. package/bios/seabios/.config.old +114 -0
  4. package/bios/seabios/.gitignore +4 -0
  5. package/bios/seabios/COPYING +674 -0
  6. package/bios/seabios/COPYING.LESSER +165 -0
  7. package/bios/seabios/Makefile +286 -0
  8. package/bios/seabios/README +17 -0
  9. package/bios/seabios/docs/Build_overview.md +104 -0
  10. package/bios/seabios/docs/Contributing.md +20 -0
  11. package/bios/seabios/docs/Debugging.md +111 -0
  12. package/bios/seabios/docs/Developer_Documentation.md +25 -0
  13. package/bios/seabios/docs/Developer_links.md +86 -0
  14. package/bios/seabios/docs/Download.md +27 -0
  15. package/bios/seabios/docs/Execution_and_code_flow.md +178 -0
  16. package/bios/seabios/docs/Linking_overview.md +160 -0
  17. package/bios/seabios/docs/Mailinglist.md +8 -0
  18. package/bios/seabios/docs/Memory_Model.md +253 -0
  19. package/bios/seabios/docs/README +5 -0
  20. package/bios/seabios/docs/Releases.md +482 -0
  21. package/bios/seabios/docs/Runtime_config.md +193 -0
  22. package/bios/seabios/docs/SeaBIOS.md +17 -0
  23. package/bios/seabios/docs/SeaVGABIOS.md +39 -0
  24. package/bios/seabios/out/autoconf.h +117 -0
  25. package/bios/seabios/out/include/config/acpi/dsdt.h +0 -0
  26. package/bios/seabios/out/include/config/acpi.h +0 -0
  27. package/bios/seabios/out/include/config/ahci.h +0 -0
  28. package/bios/seabios/out/include/config/apmbios.h +0 -0
  29. package/bios/seabios/out/include/config/ata/dma.h +0 -0
  30. package/bios/seabios/out/include/config/ata/pio32.h +0 -0
  31. package/bios/seabios/out/include/config/ata.h +0 -0
  32. package/bios/seabios/out/include/config/auto.conf +69 -0
  33. package/bios/seabios/out/include/config/auto.conf.cmd +9 -0
  34. package/bios/seabios/out/include/config/boot.h +0 -0
  35. package/bios/seabios/out/include/config/bootorder.h +0 -0
  36. package/bios/seabios/out/include/config/build/vgabios.h +0 -0
  37. package/bios/seabios/out/include/config/call32/smm.h +0 -0
  38. package/bios/seabios/out/include/config/cdrom/boot.h +0 -0
  39. package/bios/seabios/out/include/config/cdrom/emu.h +0 -0
  40. package/bios/seabios/out/include/config/debug/level.h +0 -0
  41. package/bios/seabios/out/include/config/drives.h +0 -0
  42. package/bios/seabios/out/include/config/entry/extrastack.h +0 -0
  43. package/bios/seabios/out/include/config/esp/scsi.h +0 -0
  44. package/bios/seabios/out/include/config/flash/floppy.h +0 -0
  45. package/bios/seabios/out/include/config/floppy.h +0 -0
  46. package/bios/seabios/out/include/config/fw/romfile/load.h +0 -0
  47. package/bios/seabios/out/include/config/hardware/irq.h +0 -0
  48. package/bios/seabios/out/include/config/kbd/call/int15/4f.h +0 -0
  49. package/bios/seabios/out/include/config/keyboard.h +0 -0
  50. package/bios/seabios/out/include/config/lpt.h +0 -0
  51. package/bios/seabios/out/include/config/lsi/scsi.h +0 -0
  52. package/bios/seabios/out/include/config/malloc/uppermemory.h +0 -0
  53. package/bios/seabios/out/include/config/megasas.h +0 -0
  54. package/bios/seabios/out/include/config/mouse.h +0 -0
  55. package/bios/seabios/out/include/config/mpt/scsi.h +0 -0
  56. package/bios/seabios/out/include/config/mptable.h +0 -0
  57. package/bios/seabios/out/include/config/mtrr/init.h +0 -0
  58. package/bios/seabios/out/include/config/optionroms.h +0 -0
  59. package/bios/seabios/out/include/config/override/pci/id.h +0 -0
  60. package/bios/seabios/out/include/config/pcibios.h +0 -0
  61. package/bios/seabios/out/include/config/pirtable.h +0 -0
  62. package/bios/seabios/out/include/config/pmm.h +0 -0
  63. package/bios/seabios/out/include/config/pmtimer.h +0 -0
  64. package/bios/seabios/out/include/config/pnpbios.h +0 -0
  65. package/bios/seabios/out/include/config/ps2port.h +0 -0
  66. package/bios/seabios/out/include/config/pvscsi.h +0 -0
  67. package/bios/seabios/out/include/config/qemu/hardware.h +0 -0
  68. package/bios/seabios/out/include/config/qemu.h +0 -0
  69. package/bios/seabios/out/include/config/rom/size.h +0 -0
  70. package/bios/seabios/out/include/config/rtc/timer.h +0 -0
  71. package/bios/seabios/out/include/config/s3/resume.h +0 -0
  72. package/bios/seabios/out/include/config/sdcard.h +0 -0
  73. package/bios/seabios/out/include/config/serial.h +0 -0
  74. package/bios/seabios/out/include/config/tcgbios.h +0 -0
  75. package/bios/seabios/out/include/config/threads.h +0 -0
  76. package/bios/seabios/out/include/config/tristate.conf +4 -0
  77. package/bios/seabios/out/include/config/tsc/timer.h +0 -0
  78. package/bios/seabios/out/include/config/use/smm.h +0 -0
  79. package/bios/seabios/out/include/config/vga/allocate/extra/stack.h +0 -0
  80. package/bios/seabios/out/include/config/vga/bochs/stdvga.h +0 -0
  81. package/bios/seabios/out/include/config/vga/bochs.h +0 -0
  82. package/bios/seabios/out/include/config/vga/did.h +0 -0
  83. package/bios/seabios/out/include/config/vga/extra/stack/size.h +0 -0
  84. package/bios/seabios/out/include/config/vga/fixup/asm.h +0 -0
  85. package/bios/seabios/out/include/config/vga/pci.h +0 -0
  86. package/bios/seabios/out/include/config/vga/stdvga/ports.h +0 -0
  87. package/bios/seabios/out/include/config/vga/vbe.h +0 -0
  88. package/bios/seabios/out/include/config/vga/vid.h +0 -0
  89. package/bios/seabios/out/include/config/vgahooks.h +0 -0
  90. package/bios/seabios/out/include/config/virtio/blk.h +0 -0
  91. package/bios/seabios/out/include/config/virtio/scsi.h +0 -0
  92. package/bios/seabios/out/include/config/xen.h +0 -0
  93. package/bios/seabios/out/scripts/kconfig/conf +0 -0
  94. package/bios/seabios/out/scripts/kconfig/conf.o +0 -0
  95. package/bios/seabios/out/scripts/kconfig/zconf.hash.c +289 -0
  96. package/bios/seabios/out/scripts/kconfig/zconf.lex.c +2420 -0
  97. package/bios/seabios/out/scripts/kconfig/zconf.tab.c +2538 -0
  98. package/bios/seabios/out/scripts/kconfig/zconf.tab.o +0 -0
  99. package/bios/seabios/scripts/acpi_extract.py +366 -0
  100. package/bios/seabios/scripts/acpi_extract_preprocess.py +41 -0
  101. package/bios/seabios/scripts/buildrom.py +56 -0
  102. package/bios/seabios/scripts/buildversion.py +134 -0
  103. package/bios/seabios/scripts/checkrom.py +95 -0
  104. package/bios/seabios/scripts/checkstack.py +226 -0
  105. package/bios/seabios/scripts/checksum.py +16 -0
  106. package/bios/seabios/scripts/encodeint.py +21 -0
  107. package/bios/seabios/scripts/gen-offsets.sh +17 -0
  108. package/bios/seabios/scripts/kconfig/.gitignore +22 -0
  109. package/bios/seabios/scripts/kconfig/Makefile +331 -0
  110. package/bios/seabios/scripts/kconfig/POTFILES.in +12 -0
  111. package/bios/seabios/scripts/kconfig/check.sh +13 -0
  112. package/bios/seabios/scripts/kconfig/conf.c +718 -0
  113. package/bios/seabios/scripts/kconfig/confdata.c +1250 -0
  114. package/bios/seabios/scripts/kconfig/expr.c +1168 -0
  115. package/bios/seabios/scripts/kconfig/expr.h +241 -0
  116. package/bios/seabios/scripts/kconfig/gconf.c +1542 -0
  117. package/bios/seabios/scripts/kconfig/gconf.glade +661 -0
  118. package/bios/seabios/scripts/kconfig/images.c +326 -0
  119. package/bios/seabios/scripts/kconfig/kxgettext.c +235 -0
  120. package/bios/seabios/scripts/kconfig/lex.zconf.c +2430 -0
  121. package/bios/seabios/scripts/kconfig/list.h +131 -0
  122. package/bios/seabios/scripts/kconfig/lkc.h +200 -0
  123. package/bios/seabios/scripts/kconfig/lkc_proto.h +57 -0
  124. package/bios/seabios/scripts/kconfig/lxdialog/.gitignore +4 -0
  125. package/bios/seabios/scripts/kconfig/lxdialog/BIG.FAT.WARNING +4 -0
  126. package/bios/seabios/scripts/kconfig/lxdialog/check-lxdialog.sh +87 -0
  127. package/bios/seabios/scripts/kconfig/lxdialog/checklist.c +332 -0
  128. package/bios/seabios/scripts/kconfig/lxdialog/dialog.h +257 -0
  129. package/bios/seabios/scripts/kconfig/lxdialog/inputbox.c +301 -0
  130. package/bios/seabios/scripts/kconfig/lxdialog/menubox.c +437 -0
  131. package/bios/seabios/scripts/kconfig/lxdialog/textbox.c +408 -0
  132. package/bios/seabios/scripts/kconfig/lxdialog/util.c +713 -0
  133. package/bios/seabios/scripts/kconfig/lxdialog/yesno.c +114 -0
  134. package/bios/seabios/scripts/kconfig/mconf.c +1036 -0
  135. package/bios/seabios/scripts/kconfig/menu.c +697 -0
  136. package/bios/seabios/scripts/kconfig/merge_config.sh +150 -0
  137. package/bios/seabios/scripts/kconfig/nconf.c +1556 -0
  138. package/bios/seabios/scripts/kconfig/nconf.gui.c +656 -0
  139. package/bios/seabios/scripts/kconfig/nconf.h +96 -0
  140. package/bios/seabios/scripts/kconfig/qconf.cc +1795 -0
  141. package/bios/seabios/scripts/kconfig/qconf.h +338 -0
  142. package/bios/seabios/scripts/kconfig/streamline_config.pl +647 -0
  143. package/bios/seabios/scripts/kconfig/symbol.c +1373 -0
  144. package/bios/seabios/scripts/kconfig/util.c +157 -0
  145. package/bios/seabios/scripts/kconfig/zconf.gperf +48 -0
  146. package/bios/seabios/scripts/kconfig/zconf.hash.c_shipped +289 -0
  147. package/bios/seabios/scripts/kconfig/zconf.l +363 -0
  148. package/bios/seabios/scripts/kconfig/zconf.lex.c_shipped +2420 -0
  149. package/bios/seabios/scripts/kconfig/zconf.tab.c_shipped +2538 -0
  150. package/bios/seabios/scripts/kconfig/zconf.y +733 -0
  151. package/bios/seabios/scripts/layoutrom.py +705 -0
  152. package/bios/seabios/scripts/python23compat.py +14 -0
  153. package/bios/seabios/scripts/readserial.py +190 -0
  154. package/bios/seabios/scripts/tarball.sh +36 -0
  155. package/bios/seabios/scripts/test-build.sh +90 -0
  156. package/bios/seabios/scripts/transdump.py +53 -0
  157. package/bios/seabios/scripts/vgafixup.py +96 -0
  158. package/bios/seabios/src/Kconfig +579 -0
  159. package/bios/seabios/src/apm.c +215 -0
  160. package/bios/seabios/src/asm-offsets.c +23 -0
  161. package/bios/seabios/src/biosvar.h +130 -0
  162. package/bios/seabios/src/block.c +623 -0
  163. package/bios/seabios/src/block.h +121 -0
  164. package/bios/seabios/src/bmp.c +117 -0
  165. package/bios/seabios/src/boot.c +793 -0
  166. package/bios/seabios/src/bootsplash.c +255 -0
  167. package/bios/seabios/src/bregs.h +80 -0
  168. package/bios/seabios/src/byteorder.h +71 -0
  169. package/bios/seabios/src/cdrom.c +322 -0
  170. package/bios/seabios/src/clock.c +506 -0
  171. package/bios/seabios/src/code16gcc.s +1 -0
  172. package/bios/seabios/src/config.h +108 -0
  173. package/bios/seabios/src/cp437.c +275 -0
  174. package/bios/seabios/src/cp437.h +1 -0
  175. package/bios/seabios/src/disk.c +779 -0
  176. package/bios/seabios/src/e820map.c +152 -0
  177. package/bios/seabios/src/e820map.h +26 -0
  178. package/bios/seabios/src/entryfuncs.S +165 -0
  179. package/bios/seabios/src/farptr.h +208 -0
  180. package/bios/seabios/src/font.c +139 -0
  181. package/bios/seabios/src/fw/acpi-dsdt-cpu-hotplug.dsl +78 -0
  182. package/bios/seabios/src/fw/acpi-dsdt-dbug.dsl +26 -0
  183. package/bios/seabios/src/fw/acpi-dsdt-hpet.dsl +36 -0
  184. package/bios/seabios/src/fw/acpi-dsdt-isa.dsl +102 -0
  185. package/bios/seabios/src/fw/acpi-dsdt-pci-crs.dsl +90 -0
  186. package/bios/seabios/src/fw/acpi-dsdt.dsl +342 -0
  187. package/bios/seabios/src/fw/acpi-dsdt.hex +554 -0
  188. package/bios/seabios/src/fw/acpi.c +685 -0
  189. package/bios/seabios/src/fw/biostables.c +491 -0
  190. package/bios/seabios/src/fw/coreboot.c +569 -0
  191. package/bios/seabios/src/fw/csm.c +347 -0
  192. package/bios/seabios/src/fw/dev-pci.h +52 -0
  193. package/bios/seabios/src/fw/dev-piix.h +29 -0
  194. package/bios/seabios/src/fw/dev-q35.h +52 -0
  195. package/bios/seabios/src/fw/lzmadecode.c +398 -0
  196. package/bios/seabios/src/fw/lzmadecode.h +67 -0
  197. package/bios/seabios/src/fw/mptable.c +197 -0
  198. package/bios/seabios/src/fw/mtrr.c +105 -0
  199. package/bios/seabios/src/fw/multiboot.c +111 -0
  200. package/bios/seabios/src/fw/paravirt.c +624 -0
  201. package/bios/seabios/src/fw/paravirt.h +63 -0
  202. package/bios/seabios/src/fw/pciinit.c +1187 -0
  203. package/bios/seabios/src/fw/pirtable.c +103 -0
  204. package/bios/seabios/src/fw/q35-acpi-dsdt.dsl +450 -0
  205. package/bios/seabios/src/fw/romfile_loader.c +259 -0
  206. package/bios/seabios/src/fw/romfile_loader.h +91 -0
  207. package/bios/seabios/src/fw/shadow.c +208 -0
  208. package/bios/seabios/src/fw/smbios.c +585 -0
  209. package/bios/seabios/src/fw/smm.c +269 -0
  210. package/bios/seabios/src/fw/smp.c +194 -0
  211. package/bios/seabios/src/fw/ssdt-misc.dsl +104 -0
  212. package/bios/seabios/src/fw/ssdt-misc.hex +88 -0
  213. package/bios/seabios/src/fw/ssdt-pcihp.dsl +36 -0
  214. package/bios/seabios/src/fw/ssdt-pcihp.hex +38 -0
  215. package/bios/seabios/src/fw/ssdt-proc.dsl +48 -0
  216. package/bios/seabios/src/fw/ssdt-proc.hex +35 -0
  217. package/bios/seabios/src/fw/xen.c +149 -0
  218. package/bios/seabios/src/fw/xen.h +125 -0
  219. package/bios/seabios/src/gen-defs.h +19 -0
  220. package/bios/seabios/src/hw/ahci.c +697 -0
  221. package/bios/seabios/src/hw/ahci.h +201 -0
  222. package/bios/seabios/src/hw/ata.c +1046 -0
  223. package/bios/seabios/src/hw/ata.h +163 -0
  224. package/bios/seabios/src/hw/blockcmd.c +372 -0
  225. package/bios/seabios/src/hw/blockcmd.h +114 -0
  226. package/bios/seabios/src/hw/dma.c +67 -0
  227. package/bios/seabios/src/hw/esp-scsi.c +241 -0
  228. package/bios/seabios/src/hw/esp-scsi.h +8 -0
  229. package/bios/seabios/src/hw/floppy.c +741 -0
  230. package/bios/seabios/src/hw/lsi-scsi.c +221 -0
  231. package/bios/seabios/src/hw/lsi-scsi.h +8 -0
  232. package/bios/seabios/src/hw/megasas.c +405 -0
  233. package/bios/seabios/src/hw/megasas.h +8 -0
  234. package/bios/seabios/src/hw/mpt-scsi.c +319 -0
  235. package/bios/seabios/src/hw/mpt-scsi.h +8 -0
  236. package/bios/seabios/src/hw/nvme-int.h +199 -0
  237. package/bios/seabios/src/hw/nvme.c +708 -0
  238. package/bios/seabios/src/hw/nvme.h +17 -0
  239. package/bios/seabios/src/hw/pci.c +133 -0
  240. package/bios/seabios/src/hw/pci.h +47 -0
  241. package/bios/seabios/src/hw/pci_ids.h +2632 -0
  242. package/bios/seabios/src/hw/pci_regs.h +556 -0
  243. package/bios/seabios/src/hw/pcidevice.c +192 -0
  244. package/bios/seabios/src/hw/pcidevice.h +76 -0
  245. package/bios/seabios/src/hw/pic.c +115 -0
  246. package/bios/seabios/src/hw/pic.h +60 -0
  247. package/bios/seabios/src/hw/ps2port.c +543 -0
  248. package/bios/seabios/src/hw/ps2port.h +67 -0
  249. package/bios/seabios/src/hw/pvscsi.c +333 -0
  250. package/bios/seabios/src/hw/pvscsi.h +8 -0
  251. package/bios/seabios/src/hw/ramdisk.c +108 -0
  252. package/bios/seabios/src/hw/rtc.c +100 -0
  253. package/bios/seabios/src/hw/rtc.h +75 -0
  254. package/bios/seabios/src/hw/sdcard.c +572 -0
  255. package/bios/seabios/src/hw/serialio.c +113 -0
  256. package/bios/seabios/src/hw/serialio.h +29 -0
  257. package/bios/seabios/src/hw/timer.c +259 -0
  258. package/bios/seabios/src/hw/tpm_drivers.c +636 -0
  259. package/bios/seabios/src/hw/tpm_drivers.h +127 -0
  260. package/bios/seabios/src/hw/usb-ehci.c +650 -0
  261. package/bios/seabios/src/hw/usb-ehci.h +177 -0
  262. package/bios/seabios/src/hw/usb-hid.c +442 -0
  263. package/bios/seabios/src/hw/usb-hid.h +29 -0
  264. package/bios/seabios/src/hw/usb-hub.c +205 -0
  265. package/bios/seabios/src/hw/usb-hub.h +64 -0
  266. package/bios/seabios/src/hw/usb-msc.c +222 -0
  267. package/bios/seabios/src/hw/usb-msc.h +10 -0
  268. package/bios/seabios/src/hw/usb-ohci.c +568 -0
  269. package/bios/seabios/src/hw/usb-ohci.h +144 -0
  270. package/bios/seabios/src/hw/usb-uas.c +289 -0
  271. package/bios/seabios/src/hw/usb-uas.h +9 -0
  272. package/bios/seabios/src/hw/usb-uhci.c +571 -0
  273. package/bios/seabios/src/hw/usb-uhci.h +128 -0
  274. package/bios/seabios/src/hw/usb-xhci.c +1161 -0
  275. package/bios/seabios/src/hw/usb-xhci.h +133 -0
  276. package/bios/seabios/src/hw/usb.c +499 -0
  277. package/bios/seabios/src/hw/usb.h +254 -0
  278. package/bios/seabios/src/hw/virtio-blk.c +211 -0
  279. package/bios/seabios/src/hw/virtio-blk.h +43 -0
  280. package/bios/seabios/src/hw/virtio-pci.c +501 -0
  281. package/bios/seabios/src/hw/virtio-pci.h +151 -0
  282. package/bios/seabios/src/hw/virtio-ring.c +147 -0
  283. package/bios/seabios/src/hw/virtio-ring.h +121 -0
  284. package/bios/seabios/src/hw/virtio-scsi.c +220 -0
  285. package/bios/seabios/src/hw/virtio-scsi.h +47 -0
  286. package/bios/seabios/src/jpeg.c +1055 -0
  287. package/bios/seabios/src/kbd.c +599 -0
  288. package/bios/seabios/src/list.h +91 -0
  289. package/bios/seabios/src/malloc.c +561 -0
  290. package/bios/seabios/src/malloc.h +70 -0
  291. package/bios/seabios/src/memmap.h +21 -0
  292. package/bios/seabios/src/misc.c +195 -0
  293. package/bios/seabios/src/mouse.c +342 -0
  294. package/bios/seabios/src/optionroms.c +475 -0
  295. package/bios/seabios/src/output.c +584 -0
  296. package/bios/seabios/src/output.h +68 -0
  297. package/bios/seabios/src/pcibios.c +241 -0
  298. package/bios/seabios/src/pmm.c +176 -0
  299. package/bios/seabios/src/pnpbios.c +88 -0
  300. package/bios/seabios/src/post.c +337 -0
  301. package/bios/seabios/src/resume.c +157 -0
  302. package/bios/seabios/src/romfile.c +146 -0
  303. package/bios/seabios/src/romfile.h +21 -0
  304. package/bios/seabios/src/romlayout.S +698 -0
  305. package/bios/seabios/src/sercon.c +677 -0
  306. package/bios/seabios/src/serial.c +317 -0
  307. package/bios/seabios/src/sha1.c +147 -0
  308. package/bios/seabios/src/sha1.h +8 -0
  309. package/bios/seabios/src/stacks.c +771 -0
  310. package/bios/seabios/src/stacks.h +68 -0
  311. package/bios/seabios/src/std/LegacyBios.h +985 -0
  312. package/bios/seabios/src/std/acpi.h +323 -0
  313. package/bios/seabios/src/std/bda.h +174 -0
  314. package/bios/seabios/src/std/disk.h +175 -0
  315. package/bios/seabios/src/std/mptable.h +77 -0
  316. package/bios/seabios/src/std/multiboot.h +260 -0
  317. package/bios/seabios/src/std/optionrom.h +59 -0
  318. package/bios/seabios/src/std/pirtable.h +35 -0
  319. package/bios/seabios/src/std/pmm.h +19 -0
  320. package/bios/seabios/src/std/pnpbios.h +24 -0
  321. package/bios/seabios/src/std/smbios.h +167 -0
  322. package/bios/seabios/src/std/tcg.h +554 -0
  323. package/bios/seabios/src/std/vbe.h +156 -0
  324. package/bios/seabios/src/std/vga.h +63 -0
  325. package/bios/seabios/src/string.c +251 -0
  326. package/bios/seabios/src/string.h +31 -0
  327. package/bios/seabios/src/system.c +357 -0
  328. package/bios/seabios/src/tcgbios.c +2014 -0
  329. package/bios/seabios/src/tcgbios.h +19 -0
  330. package/bios/seabios/src/types.h +156 -0
  331. package/bios/seabios/src/util.h +251 -0
  332. package/bios/seabios/src/version.c +5 -0
  333. package/bios/seabios/src/vgahooks.c +355 -0
  334. package/bios/seabios/src/x86.c +23 -0
  335. package/bios/seabios/src/x86.h +277 -0
  336. package/bios/seabios/vgasrc/Kconfig +211 -0
  337. package/bios/seabios/vgasrc/bochsdisplay.c +59 -0
  338. package/bios/seabios/vgasrc/bochsvga.c +447 -0
  339. package/bios/seabios/vgasrc/bochsvga.h +57 -0
  340. package/bios/seabios/vgasrc/cbvga.c +337 -0
  341. package/bios/seabios/vgasrc/clext.c +627 -0
  342. package/bios/seabios/vgasrc/geodevga.c +434 -0
  343. package/bios/seabios/vgasrc/geodevga.h +89 -0
  344. package/bios/seabios/vgasrc/ramfb.c +163 -0
  345. package/bios/seabios/vgasrc/stdvga.c +485 -0
  346. package/bios/seabios/vgasrc/stdvga.h +81 -0
  347. package/bios/seabios/vgasrc/stdvgaio.c +186 -0
  348. package/bios/seabios/vgasrc/stdvgamodes.c +534 -0
  349. package/bios/seabios/vgasrc/swcursor.c +96 -0
  350. package/bios/seabios/vgasrc/vbe.c +432 -0
  351. package/bios/seabios/vgasrc/vgabios.c +1131 -0
  352. package/bios/seabios/vgasrc/vgabios.h +88 -0
  353. package/bios/seabios/vgasrc/vgaentry.S +161 -0
  354. package/bios/seabios/vgasrc/vgafb.c +661 -0
  355. package/bios/seabios/vgasrc/vgafb.h +42 -0
  356. package/bios/seabios/vgasrc/vgafonts.c +785 -0
  357. package/bios/seabios/vgasrc/vgahw.h +152 -0
  358. package/bios/seabios/vgasrc/vgainit.c +202 -0
  359. package/bios/seabios/vgasrc/vgalayout.lds.S +23 -0
  360. package/bios/seabios/vgasrc/vgautil.h +103 -0
  361. package/bios/seabios/vgasrc/vgaversion.c +6 -0
  362. package/build/binaries.js +1 -1
  363. package/build/index-debug.cjs +1 -1
  364. package/build/index-debug.js +1 -1
  365. package/build/index.cjs +1 -1
  366. package/build/index.js +1 -1
  367. package/build/v86-debug.wasm +0 -0
  368. package/build/v86.wasm +0 -0
  369. package/package.json +1 -1
@@ -0,0 +1,636 @@
1
+ // Implementation of a TPM driver for the TPM TIS interface
2
+ //
3
+ // Copyright (C) 2006-2011 IBM Corporation
4
+ //
5
+ // Authors:
6
+ // Stefan Berger <stefanb@linux.vnet.ibm.com>
7
+ //
8
+ // This file may be distributed under the terms of the GNU LGPLv3 license.
9
+
10
+ #include "byteorder.h" // be32_to_cpu
11
+ #include "config.h" // CONFIG_TPM_TIS_SHA1THRESHOLD
12
+ #include "hw/tpm_drivers.h" // struct tpm_driver
13
+ #include "std/tcg.h" // TCG_RESPONSE_TIMEOUT
14
+ #include "output.h" // warn_timeout
15
+ #include "stacks.h" // yield
16
+ #include "string.h" // memcpy
17
+ #include "util.h" // timer_calc_usec
18
+ #include "x86.h" // readl
19
+
20
+ /* low level driver implementation */
21
+ struct tpm_driver {
22
+ u32 *timeouts;
23
+ u32 *durations;
24
+ void (*set_timeouts)(u32 timeouts[4], u32 durations[3]);
25
+ u32 (*probe)(void);
26
+ TPMVersion (*get_tpm_version)(void);
27
+ u32 (*init)(void);
28
+ u32 (*activate)(u8 locty);
29
+ u32 (*ready)(void);
30
+ u32 (*senddata)(const u8 *const data, u32 len);
31
+ u32 (*readresp)(u8 *buffer, u32 *len);
32
+ u32 (*waitdatavalid)(void);
33
+ u32 (*waitrespready)(enum tpmDurationType to_t);
34
+ };
35
+
36
+ extern struct tpm_driver tpm_drivers[];
37
+
38
+ #define TIS_DRIVER_IDX 0
39
+ #define CRB_DRIVER_IDX 1
40
+ #define TPM_NUM_DRIVERS 2
41
+
42
+ #define TPM_INVALID_DRIVER 0xf
43
+
44
+ static const u32 tis_default_timeouts[4] = {
45
+ TIS_DEFAULT_TIMEOUT_A,
46
+ TIS_DEFAULT_TIMEOUT_B,
47
+ TIS_DEFAULT_TIMEOUT_C,
48
+ TIS_DEFAULT_TIMEOUT_D,
49
+ };
50
+
51
+ static const u32 tpm_default_durations[3] = {
52
+ TPM_DEFAULT_DURATION_SHORT,
53
+ TPM_DEFAULT_DURATION_MEDIUM,
54
+ TPM_DEFAULT_DURATION_LONG,
55
+ };
56
+
57
+ /* determined values */
58
+ static u32 tpm_default_dur[3];
59
+ static u32 tpm_default_to[4];
60
+
61
+ static u32 crb_cmd_size;
62
+ static void *crb_cmd;
63
+ static u32 crb_resp_size;
64
+ static void *crb_resp;
65
+
66
+ static u32 wait_reg8(u8* reg, u32 time, u8 mask, u8 expect)
67
+ {
68
+ if (!CONFIG_TCGBIOS)
69
+ return 0;
70
+
71
+ u32 rc = 1;
72
+ u32 end = timer_calc_usec(time);
73
+
74
+ for (;;) {
75
+ u8 value = readl(reg);
76
+ if ((value & mask) == expect) {
77
+ rc = 0;
78
+ break;
79
+ }
80
+ if (timer_check(end)) {
81
+ warn_timeout();
82
+ break;
83
+ }
84
+ yield();
85
+ }
86
+ return rc;
87
+ }
88
+
89
+ static u32 tis_wait_access(u8 locty, u32 time, u8 mask, u8 expect)
90
+ {
91
+ return wait_reg8(TIS_REG(locty, TIS_REG_ACCESS), time, mask, expect);
92
+ }
93
+
94
+ static u32 tis_wait_sts(u8 locty, u32 time, u8 mask, u8 expect)
95
+ {
96
+ return wait_reg8(TIS_REG(locty, TIS_REG_STS), time, mask, expect);
97
+ }
98
+
99
+ static u32 crb_wait_reg(u8 locty, u16 reg, u32 time, u8 mask, u8 expect)
100
+ {
101
+ return wait_reg8(CRB_REG(locty, reg), time, mask, expect);
102
+ }
103
+
104
+ /* if device is not there, return '0', '1' otherwise */
105
+ static u32 tis_probe(void)
106
+ {
107
+ if (!CONFIG_TCGBIOS)
108
+ return 0;
109
+
110
+ /* Wait for the interface to report it's ready */
111
+ u32 rc = tis_wait_access(0, TIS_DEFAULT_TIMEOUT_A,
112
+ TIS_ACCESS_TPM_REG_VALID_STS,
113
+ TIS_ACCESS_TPM_REG_VALID_STS);
114
+ if (rc)
115
+ return 0;
116
+
117
+ u32 didvid = readl(TIS_REG(0, TIS_REG_DID_VID));
118
+
119
+ if ((didvid != 0) && (didvid != 0xffffffff))
120
+ rc = 1;
121
+
122
+ /* TPM 2 has an interface register */
123
+ u32 ifaceid = readl(TIS_REG(0, TIS_REG_IFACE_ID));
124
+
125
+ if ((ifaceid & 0xf) != 0xf) {
126
+ if ((ifaceid & 0xf) == 1) {
127
+ /* CRB is active; no TIS */
128
+ return 0;
129
+ }
130
+ if ((ifaceid & (1 << 13)) == 0) {
131
+ /* TIS cannot be selected */
132
+ return 0;
133
+ }
134
+ /* write of 0 to bits 17-18 selects TIS */
135
+ writel(TIS_REG(0, TIS_REG_IFACE_ID), 0);
136
+ /* since we only support TIS, we lock it */
137
+ writel(TIS_REG(0, TIS_REG_IFACE_ID), (1 << 19));
138
+ }
139
+
140
+ return rc;
141
+ }
142
+
143
+ static TPMVersion tis_get_tpm_version(void)
144
+ {
145
+ u32 reg = readl(TIS_REG(0, TIS_REG_IFACE_ID));
146
+
147
+ /*
148
+ * FIFO interface as defined in TIS1.3 is active
149
+ * Interface capabilities are defined in TIS_REG_INTF_CAPABILITY
150
+ */
151
+ if ((reg & 0xf) == 0xf) {
152
+ reg = readl(TIS_REG(0, TIS_REG_INTF_CAPABILITY));
153
+ /* Interface 1.3 for TPM 2.0 */
154
+ if (((reg >> 28) & 0x7) == 3)
155
+ return TPM_VERSION_2;
156
+ }
157
+ /* FIFO interface as defined in PTP for TPM 2.0 is active */
158
+ else if ((reg & 0xf) == 0) {
159
+ return TPM_VERSION_2;
160
+ }
161
+
162
+ return TPM_VERSION_1_2;
163
+ }
164
+
165
+ static void init_timeout(int driver)
166
+ {
167
+ if (tpm_drivers[driver].durations == NULL) {
168
+ u32 *durations = tpm_default_dur;
169
+ memcpy(durations, tpm_default_durations,
170
+ sizeof(tpm_default_durations));
171
+ tpm_drivers[driver].durations = durations;
172
+ }
173
+
174
+ if (tpm_drivers[driver].timeouts == NULL) {
175
+ u32 *timeouts = tpm_default_to;
176
+ memcpy(timeouts, tis_default_timeouts,
177
+ sizeof(tis_default_timeouts));
178
+ tpm_drivers[driver].timeouts = timeouts;
179
+ }
180
+ }
181
+
182
+ static u32 tis_init(void)
183
+ {
184
+ if (!CONFIG_TCGBIOS)
185
+ return 1;
186
+
187
+ writeb(TIS_REG(0, TIS_REG_INT_ENABLE), 0);
188
+
189
+ init_timeout(TIS_DRIVER_IDX);
190
+
191
+ return 1;
192
+ }
193
+
194
+
195
+ static void set_timeouts(u32 timeouts[4], u32 durations[3])
196
+ {
197
+ if (!CONFIG_TCGBIOS)
198
+ return;
199
+
200
+ u32 *tos = tpm_drivers[TIS_DRIVER_IDX].timeouts;
201
+ u32 *dus = tpm_drivers[TIS_DRIVER_IDX].durations;
202
+
203
+ if (tos && tos != tis_default_timeouts && timeouts)
204
+ memcpy(tos, timeouts, 4 * sizeof(u32));
205
+ if (dus && dus != tpm_default_durations && durations)
206
+ memcpy(dus, durations, 3 * sizeof(u32));
207
+ }
208
+
209
+ static u32 tis_activate(u8 locty)
210
+ {
211
+ if (!CONFIG_TCGBIOS)
212
+ return 0;
213
+
214
+ u32 rc = 0;
215
+ u8 acc;
216
+ int l;
217
+ u32 timeout_a = tpm_drivers[TIS_DRIVER_IDX].timeouts[TIS_TIMEOUT_TYPE_A];
218
+
219
+ if (!(readb(TIS_REG(locty, TIS_REG_ACCESS)) &
220
+ TIS_ACCESS_ACTIVE_LOCALITY)) {
221
+ /* release locality in use top-downwards */
222
+ for (l = 4; l >= 0; l--)
223
+ writeb(TIS_REG(l, TIS_REG_ACCESS),
224
+ TIS_ACCESS_ACTIVE_LOCALITY);
225
+ }
226
+
227
+ /* request access to locality */
228
+ writeb(TIS_REG(locty, TIS_REG_ACCESS), TIS_ACCESS_REQUEST_USE);
229
+
230
+ acc = readb(TIS_REG(locty, TIS_REG_ACCESS));
231
+ if ((acc & TIS_ACCESS_ACTIVE_LOCALITY)) {
232
+ writeb(TIS_REG(locty, TIS_REG_STS), TIS_STS_COMMAND_READY);
233
+ rc = tis_wait_sts(locty, timeout_a,
234
+ TIS_STS_COMMAND_READY, TIS_STS_COMMAND_READY);
235
+ }
236
+
237
+ return rc;
238
+ }
239
+
240
+ static u32 tis_find_active_locality(void)
241
+ {
242
+ if (!CONFIG_TCGBIOS)
243
+ return 0;
244
+
245
+ u8 locty;
246
+
247
+ for (locty = 0; locty <= 4; locty++) {
248
+ if ((readb(TIS_REG(locty, TIS_REG_ACCESS)) &
249
+ TIS_ACCESS_ACTIVE_LOCALITY))
250
+ return locty;
251
+ }
252
+
253
+ tis_activate(0);
254
+
255
+ return 0;
256
+ }
257
+
258
+ static u32 tis_ready(void)
259
+ {
260
+ if (!CONFIG_TCGBIOS)
261
+ return 0;
262
+
263
+ u32 rc = 0;
264
+ u8 locty = tis_find_active_locality();
265
+ u32 timeout_b = tpm_drivers[TIS_DRIVER_IDX].timeouts[TIS_TIMEOUT_TYPE_B];
266
+
267
+ writeb(TIS_REG(locty, TIS_REG_STS), TIS_STS_COMMAND_READY);
268
+ rc = tis_wait_sts(locty, timeout_b,
269
+ TIS_STS_COMMAND_READY, TIS_STS_COMMAND_READY);
270
+
271
+ return rc;
272
+ }
273
+
274
+ static u32 tis_senddata(const u8 *const data, u32 len)
275
+ {
276
+ if (!CONFIG_TCGBIOS)
277
+ return 0;
278
+
279
+ u32 rc = 0;
280
+ u32 offset = 0;
281
+ u32 end_loop = 0;
282
+ u16 burst = 0;
283
+ u8 locty = tis_find_active_locality();
284
+ u32 timeout_d = tpm_drivers[TIS_DRIVER_IDX].timeouts[TIS_TIMEOUT_TYPE_D];
285
+ u32 end = timer_calc_usec(timeout_d);
286
+
287
+ do {
288
+ while (burst == 0) {
289
+ burst = readl(TIS_REG(locty, TIS_REG_STS)) >> 8;
290
+ if (burst == 0) {
291
+ if (timer_check(end)) {
292
+ warn_timeout();
293
+ break;
294
+ }
295
+ yield();
296
+ }
297
+ }
298
+
299
+ if (burst == 0) {
300
+ rc = TCG_RESPONSE_TIMEOUT;
301
+ break;
302
+ }
303
+
304
+ while (1) {
305
+ writeb(TIS_REG(locty, TIS_REG_DATA_FIFO), data[offset++]);
306
+ burst--;
307
+
308
+ if (burst == 0 || offset == len)
309
+ break;
310
+ }
311
+
312
+ if (offset == len)
313
+ end_loop = 1;
314
+ } while (end_loop == 0);
315
+
316
+ return rc;
317
+ }
318
+
319
+ static u32 tis_readresp(u8 *buffer, u32 *len)
320
+ {
321
+ if (!CONFIG_TCGBIOS)
322
+ return 0;
323
+
324
+ u32 rc = 0;
325
+ u32 offset = 0;
326
+ u32 sts;
327
+ u8 locty = tis_find_active_locality();
328
+
329
+ while (offset < *len) {
330
+ buffer[offset] = readb(TIS_REG(locty, TIS_REG_DATA_FIFO));
331
+ offset++;
332
+ sts = readb(TIS_REG(locty, TIS_REG_STS));
333
+ /* data left ? */
334
+ if ((sts & TIS_STS_DATA_AVAILABLE) == 0)
335
+ break;
336
+ }
337
+
338
+ *len = offset;
339
+
340
+ return rc;
341
+ }
342
+
343
+
344
+ static u32 tis_waitdatavalid(void)
345
+ {
346
+ if (!CONFIG_TCGBIOS)
347
+ return 0;
348
+
349
+ u32 rc = 0;
350
+ u8 locty = tis_find_active_locality();
351
+ u32 timeout_c = tpm_drivers[TIS_DRIVER_IDX].timeouts[TIS_TIMEOUT_TYPE_C];
352
+
353
+ if (tis_wait_sts(locty, timeout_c, TIS_STS_VALID, TIS_STS_VALID) != 0)
354
+ rc = 1;
355
+
356
+ return rc;
357
+ }
358
+
359
+ static u32 tis_waitrespready(enum tpmDurationType to_t)
360
+ {
361
+ if (!CONFIG_TCGBIOS)
362
+ return 0;
363
+
364
+ u32 rc = 0;
365
+ u8 locty = tis_find_active_locality();
366
+ u32 timeout = tpm_drivers[TIS_DRIVER_IDX].durations[to_t];
367
+
368
+ writeb(TIS_REG(locty ,TIS_REG_STS), TIS_STS_TPM_GO);
369
+
370
+ if (tis_wait_sts(locty, timeout,
371
+ TIS_STS_DATA_AVAILABLE, TIS_STS_DATA_AVAILABLE) != 0)
372
+ rc = 1;
373
+
374
+ return rc;
375
+ }
376
+
377
+ #define CRB_STATE_VALID_STS 0b10000000
378
+ #define CRB_STATE_LOC_ASSIGNED 0x00000010
379
+ #define CRB_STATE_READY_MASK (CRB_STATE_VALID_STS | CRB_STATE_LOC_ASSIGNED)
380
+
381
+ /* if device is not there, return '0', '1' otherwise */
382
+ static u32 crb_probe(void)
383
+ {
384
+ if (!CONFIG_TCGBIOS)
385
+ return 0;
386
+
387
+ /* Wait for the interface to report it's ready */
388
+ u32 rc = crb_wait_reg(0, CRB_REG_LOC_STATE, TIS2_DEFAULT_TIMEOUT_D,
389
+ CRB_STATE_READY_MASK, CRB_STATE_VALID_STS);
390
+ if (rc)
391
+ return 0;
392
+
393
+ u32 ifaceid = readl(CRB_REG(0, CRB_REG_INTF_ID));
394
+
395
+ if ((ifaceid & 0xf) != 0xf) {
396
+ if ((ifaceid & 0xf) == 1) {
397
+ /* CRB is active */
398
+ } else if ((ifaceid & (1 << 14)) == 0) {
399
+ /* CRB cannot be selected */
400
+ return 0;
401
+ }
402
+ /* write of 1 to bits 17-18 selects CRB */
403
+ writel(CRB_REG(0, CRB_REG_INTF_ID), (1 << 17));
404
+ /* lock it */
405
+ writel(CRB_REG(0, CRB_REG_INTF_ID), (1 << 19));
406
+ }
407
+
408
+ /* no support for 64 bit addressing yet */
409
+ if (readl(CRB_REG(0, CRB_REG_CTRL_CMD_HADDR)))
410
+ return 0;
411
+
412
+ u64 addr = readq(CRB_REG(0, CRB_REG_CTRL_RSP_ADDR));
413
+ if (addr > 0xffffffff)
414
+ return 0;
415
+
416
+ return 1;
417
+ }
418
+
419
+ static TPMVersion crb_get_tpm_version(void)
420
+ {
421
+ /* CRB is supposed to be TPM 2.0 only */
422
+ return TPM_VERSION_2;
423
+ }
424
+
425
+ static u32 crb_init(void)
426
+ {
427
+ if (!CONFIG_TCGBIOS)
428
+ return 1;
429
+
430
+ crb_cmd = (void*)readl(CRB_REG(0, CRB_REG_CTRL_CMD_LADDR));
431
+ crb_cmd_size = readl(CRB_REG(0, CRB_REG_CTRL_CMD_SIZE));
432
+ crb_resp = (void*)readl(CRB_REG(0, CRB_REG_CTRL_RSP_ADDR));
433
+ crb_resp_size = readl(CRB_REG(0, CRB_REG_CTRL_RSP_SIZE));
434
+
435
+ init_timeout(CRB_DRIVER_IDX);
436
+
437
+ return 0;
438
+ }
439
+
440
+ static u32 crb_activate(u8 locty)
441
+ {
442
+ if (!CONFIG_TCGBIOS)
443
+ return 0;
444
+
445
+ writeb(CRB_REG(locty, CRB_REG_LOC_CTRL), 1);
446
+
447
+ return 0;
448
+ }
449
+
450
+ static u32 crb_find_active_locality(void)
451
+ {
452
+ if (!CONFIG_TCGBIOS)
453
+ return 0;
454
+
455
+ return 0;
456
+ }
457
+
458
+ #define CRB_CTRL_REQ_CMD_READY 0b1
459
+ #define CRB_START_INVOKE 0b1
460
+ #define CRB_CTRL_STS_ERROR 0b1
461
+
462
+ static u32 crb_ready(void)
463
+ {
464
+ if (!CONFIG_TCGBIOS)
465
+ return 0;
466
+
467
+ u32 rc = 0;
468
+ u8 locty = crb_find_active_locality();
469
+ u32 timeout_c = tpm_drivers[CRB_DRIVER_IDX].timeouts[TIS_TIMEOUT_TYPE_C];
470
+
471
+ writel(CRB_REG(locty, CRB_REG_CTRL_REQ), CRB_CTRL_REQ_CMD_READY);
472
+ rc = crb_wait_reg(locty, CRB_REG_CTRL_REQ, timeout_c,
473
+ CRB_CTRL_REQ_CMD_READY, 0);
474
+
475
+ return rc;
476
+ }
477
+
478
+ static u32 crb_senddata(const u8 *const data, u32 len)
479
+ {
480
+ if (!CONFIG_TCGBIOS)
481
+ return 0;
482
+
483
+ if (len > crb_cmd_size)
484
+ return 1;
485
+
486
+ u8 locty = crb_find_active_locality();
487
+ memcpy(crb_cmd, data, len);
488
+ writel(CRB_REG(locty, CRB_REG_CTRL_START), CRB_START_INVOKE);
489
+
490
+ return 0;
491
+ }
492
+
493
+ static u32 crb_readresp(u8 *buffer, u32 *len)
494
+ {
495
+ if (!CONFIG_TCGBIOS)
496
+ return 0;
497
+
498
+ u8 locty = crb_find_active_locality();
499
+ if (readl(CRB_REG(locty, CRB_REG_CTRL_STS)) & CRB_CTRL_STS_ERROR)
500
+ return 1;
501
+
502
+ if (*len < 6)
503
+ return 1;
504
+
505
+ memcpy(buffer, crb_resp, 6);
506
+ u32 expected = be32_to_cpu(*(u32 *) &buffer[2]);
507
+ if (expected < 6)
508
+ return 1;
509
+
510
+ *len = (*len < expected) ? *len : expected;
511
+
512
+ memcpy(buffer + 6, crb_resp + 6, *len - 6);
513
+
514
+ return 0;
515
+ }
516
+
517
+
518
+ static u32 crb_waitdatavalid(void)
519
+ {
520
+ return 0;
521
+ }
522
+
523
+ static u32 crb_waitrespready(enum tpmDurationType to_t)
524
+ {
525
+ if (!CONFIG_TCGBIOS)
526
+ return 0;
527
+
528
+ u32 rc = 0;
529
+ u8 locty = crb_find_active_locality();
530
+ u32 timeout = tpm_drivers[CRB_DRIVER_IDX].durations[to_t];
531
+
532
+ rc = crb_wait_reg(locty, CRB_REG_CTRL_START, timeout,
533
+ CRB_START_INVOKE, 0);
534
+
535
+ return rc;
536
+ }
537
+
538
+ struct tpm_driver tpm_drivers[TPM_NUM_DRIVERS] = {
539
+ [TIS_DRIVER_IDX] =
540
+ {
541
+ .timeouts = NULL,
542
+ .durations = NULL,
543
+ .set_timeouts = set_timeouts,
544
+ .probe = tis_probe,
545
+ .get_tpm_version = tis_get_tpm_version,
546
+ .init = tis_init,
547
+ .activate = tis_activate,
548
+ .ready = tis_ready,
549
+ .senddata = tis_senddata,
550
+ .readresp = tis_readresp,
551
+ .waitdatavalid = tis_waitdatavalid,
552
+ .waitrespready = tis_waitrespready,
553
+ },
554
+ [CRB_DRIVER_IDX] =
555
+ {
556
+ .timeouts = NULL,
557
+ .durations = NULL,
558
+ .set_timeouts = set_timeouts,
559
+ .probe = crb_probe,
560
+ .get_tpm_version = crb_get_tpm_version,
561
+ .init = crb_init,
562
+ .activate = crb_activate,
563
+ .ready = crb_ready,
564
+ .senddata = crb_senddata,
565
+ .readresp = crb_readresp,
566
+ .waitdatavalid = crb_waitdatavalid,
567
+ .waitrespready = crb_waitrespready,
568
+ },
569
+ };
570
+
571
+ static u8 TPMHW_driver_to_use = TPM_INVALID_DRIVER;
572
+
573
+ TPMVersion
574
+ tpmhw_probe(void)
575
+ {
576
+ unsigned int i;
577
+ for (i = 0; i < TPM_NUM_DRIVERS; i++) {
578
+ struct tpm_driver *td = &tpm_drivers[i];
579
+ if (td->probe() != 0) {
580
+ td->init();
581
+ TPMHW_driver_to_use = i;
582
+ return td->get_tpm_version();
583
+ }
584
+ }
585
+ return TPM_VERSION_NONE;
586
+ }
587
+
588
+ int
589
+ tpmhw_is_present(void)
590
+ {
591
+ return TPMHW_driver_to_use != TPM_INVALID_DRIVER;
592
+ }
593
+
594
+ int
595
+ tpmhw_transmit(u8 locty, struct tpm_req_header *req,
596
+ void *respbuffer, u32 *respbufferlen,
597
+ enum tpmDurationType to_t)
598
+ {
599
+ if (TPMHW_driver_to_use == TPM_INVALID_DRIVER)
600
+ return -1;
601
+
602
+ struct tpm_driver *td = &tpm_drivers[TPMHW_driver_to_use];
603
+
604
+ u32 irc = td->activate(locty);
605
+ if (irc != 0) {
606
+ /* tpm could not be activated */
607
+ return -1;
608
+ }
609
+
610
+ irc = td->senddata((void*)req, be32_to_cpu(req->totlen));
611
+ if (irc != 0)
612
+ return -1;
613
+
614
+ irc = td->waitdatavalid();
615
+ if (irc != 0)
616
+ return -1;
617
+
618
+ irc = td->waitrespready(to_t);
619
+ if (irc != 0)
620
+ return -1;
621
+
622
+ irc = td->readresp(respbuffer, respbufferlen);
623
+ if (irc != 0)
624
+ return -1;
625
+
626
+ td->ready();
627
+
628
+ return 0;
629
+ }
630
+
631
+ void
632
+ tpmhw_set_timeouts(u32 timeouts[4], u32 durations[3])
633
+ {
634
+ struct tpm_driver *td = &tpm_drivers[TPMHW_driver_to_use];
635
+ td->set_timeouts(timeouts, durations);
636
+ }