Driver Writer’s Guide for UEFI 2.0 Draft for Review
xvi 2007.04.10 Version 0.95
Example 19. Goto Expressions .........................................................................73
Example 20. Protocol C File .............................................................................76
Example 21. Protocol Include File .....................................................................77
Example 22. GUID Include File.........................................................................78
Example 23. GUID C File.................................................................................78
Example 24. Including a Protocol or a GUID.......................................................79
Example 25. Driver Include File Template...........................................................83
Example 26. Driver Implementation Template.....................................................85
Example 27. Protocol Implementation Template ..................................................86
Example 28. Initializing the UEFI driver Library ...................................................87
Example 29. Allocate and Free Pool ...................................................................91
Example 30. Allocate and Free Pages .................................................................92
Example 31. Allocate and Free Buffer.................................................................93
Example 32. Allocate and Copy Buffer................................................................93
Example 33. Install Driver Protocols ..................................................................95
Example 34. Install I/O Protocols ......................................................................96
Example 35. Install Tag GUID...........................................................................97
Example 36. Locate All Handles.........................................................................98
Example 37. Locate Block I/O Protocol Handles ...................................................99
Example 38. Locate Decompress Protocol ......................................................... 100
Example 39. Open Protocol BY_DRIVER........................................................... 102
Example 40. Open Protocol by TEST_PROTOCOL............................................... 103
Example 41. Open Protocol by GET_PROTOCOL ................................................ 104
Example 42. Open Protocol BY_CHILD_CONTROLLER ........................................ 105
Example 43. Open Protocol Information .......................................................... 106
Example 44. Global Lock ............................................................................... 107
Example 45. Exit Boot Services Event ............................................................. 108
Example 46. Set Virtual Address Map Event ..................................................... 109
Example 47. Wait for Event ........................................................................... 111
Example 48. Wait for a One-Shot Timer Event.................................................. 112
Example 49. Reinstall Protocol Interface.......................................................... 114
Example 50. Locate Device Path..................................................................... 115
Example 51. Connect and Disconnect Controller ............................................... 116
Example 52. Disconnect Controller ................................................................. 117
Example 53. Reading and Writing Fixed-Size UEFI variables ............................... 119
Example 54. Reading and Writing Variable-Sized UEFI variables.......................... 120
Example 55. Install Configuration Table........................................................... 121
Example 56. Computing 32-bit CRC Values ...................................................... 122
Example 57. Validating 32-bit CRC Values ....................................................... 122
Example 58. Stall Loop ................................................................................. 128
Example 59. Stall Service.............................................................................. 129
Example 60. Starting a Periodic Timer............................................................. 131
Example 61. Arming a One-Shot Timer ........................................................... 132
Example 62. Stopping a Timer ....................................................................... 133
Example 63. Time and Date Services .............................................................. 133
Example 64. PCI Bus Walk Example................................................................. 148
Example 65. Generic Entry Point ..................................................................... 176