Lenovo ThinkPad 560E TP 560Z Technical Reference Manual - Page 68

Calling Convention, Parameter Structure, Input Field

Page 68 highlights

Calling Convention The client can invoke the SMAPI BIOS with a far-call to the entry point that is specified in the header file. All parameters for the BIOS and other results are stored in the client data area; the client needs to prepare an input parameter and output parameter area in its data area, and informs this area by pushing those pointers onto its stack before the far-calls. The SMAPI BIOS uses the stack/data area directly with the selector when the BIOS is invoked. Therefore, the caller needs to define the same privilege level as the BIOS. Parameter Structure The memory allocation for the input/output field should be prepared by the caller. The input field specifies the function request to the SMAPI BIOS, and the BIOS fills in the return value to the output field. Input Field Field Major function number Minor function number Parameter 1 Parameter 2 Parameter 3 Parameter 4 Parameter 5 Offset X'00' X'01' X'02' X'04' X'06' X'08' X'0C' Length Byte Byte Word Word Word Doubleword Doubleword Output Field Field Return code Auxiliary return code Parameter 1 Parameter 2 Parameter 3 Parameter 4 Parameter 5 Offset X'00' X'01' X'02' X'04' X'06' X'08' X'0C' Length Byte Byte Word Word Word Doubleword Doubleword A-6 ThinkPad 560Z SMAPI BIOS

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134

Calling Convention
The client can invoke the SMAPI BIOS with a far-call to the entry
point that is specified in the header file.
All parameters for the BIOS
and other results are stored in the client data area; the client needs
to prepare an input parameter and output parameter area in its data
area, and informs this area by pushing those pointers onto its stack
before the far-calls.
The SMAPI BIOS uses the stack/data area directly with the selector
when the BIOS is invoked.
Therefore, the caller needs to define the
same privilege level as the BIOS.
Parameter Structure
The memory allocation for the input/output field should be prepared
by the caller.
The input field specifies the function request to the
SMAPI BIOS, and the BIOS fills in the return value to the output
field.
Input Field
Field
Offset
Length
Major function number
X
'
00
'
Byte
Minor function number
X
'
01
'
Byte
Parameter 1
X
'
02
'
Word
Parameter 2
X
'
04
'
Word
Parameter 3
X
'
06
'
Word
Parameter 4
X
'
08
'
Doubleword
Parameter 5
X
'
0C
'
Doubleword
Output Field
Field
Offset
Length
Return code
X
'
00
'
Byte
Auxiliary return code
X
'
01
'
Byte
Parameter 1
X
'
02
'
Word
Parameter 2
X
'
04
'
Word
Parameter 3
X
'
06
'
Word
Parameter 4
X
'
08
'
Doubleword
Parameter 5
X
'
0C
'
Doubleword
A-6
ThinkPad 560Z SMAPI BIOS