3 * Copyright (C) 2003 Eric Kohl
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 * U32 PnpBiosSupported(VOID);
33 _pnp_bios_entry_point:
35 _pnp_bios_data_segment:
38 EXTERN(_PnpBiosSupported)
53 cmp eax, 0x506E5024 /* "$PnP" */
64 /* first calculate the checksum */
82 /* Calculate the bios entry point (far pointer) */
87 mov _pnp_bios_entry_point, eax
89 /* Store bios data segment */
91 mov _pnp_bios_data_segment, ax
105 * U32 PnpBiosGetDeviceNodeCount(U32 *NodeSize, U32 *NodeCount);
116 EXTERN(_PnpBiosGetDeviceNodeCount)
125 call x86_64_SwitchToReal
128 mov ax, _pnp_bios_data_segment
132 mov ax, _pnp_node_size
136 mov ax, _pnp_node_count
141 call [_pnp_bios_entry_point]
147 call x86_16_SwitchToLong
150 mov esi, [rbp + 0x08]
151 mov ax, _pnp_node_size
155 mov rsi, [ebp + 0x0C]
156 mov ax, _pnp_node_count
173 * U32 PnpBiosGetDeviceNode(U8 *NodeId, U8 *NodeBuffer);
185 EXTERN(_PnpBiosGetDeviceNode)
194 /* get current node number */
195 mov rsi, [rbp + 0x08]
197 mov _pnp_node_number, al
199 /* convert pointer to node buffer to segment/offset */
200 mov eax, [rbp + 0x0C]
203 mov _pnp_buffer_segment , ax
204 mov eax, [rbp + 0x0C]
206 mov _pnp_buffer_offset, ax
208 call x86_64_SwitchToReal
211 /* push bios segment */
212 mov ax, _pnp_bios_data_segment
215 /* push control flag */
218 /* push pointer to node buffer (segment/offset) */
219 mov ax, _pnp_buffer_segment
221 mov ax, _pnp_buffer_offset
224 /* push pointer to node number (segment/offset) */
226 mov ax, _pnp_node_number
229 /* push function number */
232 /* call entry point */
233 call [_pnp_bios_entry_point]
239 call x86_16_SwitchToLong
242 /* update node number */
243 mov rsi, [rbp + 0x08]
244 mov al, _pnp_node_number