#include <agnix/agnix.h>#include <agnix/init.h>Include dependency graph for pm.c:

Go to the source code of this file.
Functions | |
| int | apm_init (void) |
| int __init | pm_init (void) |
|
|
Definition at line 272 of file apm.c. References apm_bios_info, apm_enable(), apm_enabled, apm_get_power_status(), apm_power_status, apm_show_power_status(), apm_task_start(), create_kernel_thread(), MOD_NAME, printk(), set_code_desc(), and set_data_desc(). Referenced by pm_init(). 00273 {
00274 apm_bios_info = APM_INFO;
00275 apm_enabled = 1;
00276
00277 if (apm_bios_info->apm_version == 0x00) {
00278 printk(MOD_NAME "not found\n");
00279 return -1;
00280 }
00281
00282 printk(MOD_NAME "Found APM ver. %d.%d\n",
00283 (apm_bios_info->apm_version >> 8) & 0xFF, apm_bios_info->apm_version & 0xFF);
00284
00285 if (apm_bios_info->apm_version != 0x100) {
00286 set_code_desc(__APM_CS >> 3, phys_to_virt((u32)(apm_bios_info->apm_cseg << 4)), (apm_bios_info->apm_cseg_len - 1) & 0xffff, 0, 1);
00287 set_code_desc(__APM_CS_16 >> 3, phys_to_virt((u32)(apm_bios_info->apm_cseg_16 << 4)), (apm_bios_info->apm_cseg_16_len - 1) & 0xffff, 0, 0);
00288 set_data_desc(__APM_DS >> 3, phys_to_virt((u32)(apm_bios_info->apm_dseg << 4)), (apm_bios_info->apm_dseg_len - 1) & 0xffff, 0, 1);
00289 } else {
00290 set_code_desc(__APM_CS >> 3, phys_to_virt((u32)(apm_bios_info->apm_cseg << 4)), 64 * 1024 - 1, 0, 1);
00291 set_code_desc(__APM_CS_16 >> 3, phys_to_virt((u32)(apm_bios_info->apm_cseg_16 << 4)), 64 * 1024 - 1, 0, 0);
00292 set_data_desc(__APM_DS >> 3, phys_to_virt((u32)(apm_bios_info->apm_dseg << 4)), 64 * 1024 - 1, 0, 1);
00293 }
00294 set_data_desc(__APM_40 >> 3, phys_to_virt((u32)(0x40 << 4)), 4095 - (0x40 << 4), 0, 1);
00295 /*
00296 set_code_desc(__APM_CS >> 3, phys_to_virt((u32)(apm_bios_info->apm_cseg << 4)), (apm_bios_info->apm_cseg_len - 1) & 0xffff, 0, 1);
00297 set_code_desc(__APM_CS_16 >> 3, phys_to_virt((u32)(apm_bios_info->apm_cseg_16 << 4)), (apm_bios_info->apm_cseg_16_len - 1) & 0xffff, 0, 0);
00298 set_data_desc(__APM_DS >> 3, phys_to_virt((u32)(apm_bios_info->apm_dseg << 4)), (apm_bios_info->apm_dseg_len - 1) & 0xffff, 0, 1);
00299 */
00300
00301 apm_indirect.offset = apm_bios_info->apm_offset;
00302 apm_indirect.segment = __APM_CS;
00303
00304 apm_enable();
00305 apm_get_power_status();
00306 apm_show_power_status(&apm_power_status);
00307 create_kernel_thread("APM", apm_task_start, NULL);
00308
00309 return 0;
00310 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 19 of file pm.c. References apm_init(). Referenced by start_kernel(). 00020 {
00021 #if CONFIG_BIOS_APM
00022 apm_init();
00023 #endif
00024
00025 return 0;
00026 }
Here is the call graph for this function: ![]() |