?? misc.c
字號:
/* * This source code is a part of coLinux source package. * * Dan Aloni <da-x@colinux.org>, 2003 (c) * * The code is licensed under the GPL. See the COPYING file at * the root directory. * */#include "../ddk.h"#include <colinux/os/kernel/misc.h>unsigned long co_os_virt_to_phys(void *addr){ PHYSICAL_ADDRESS pa; pa = MmGetPhysicalAddress((PVOID)addr); return pa.QuadPart;}co_rc_t co_os_physical_memory_pages(unsigned long *pages){ SYSTEM_BASIC_INFORMATION sbi; NTSTATUS status; co_rc_t rc = CO_RC(OK); status = NtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), NULL); if (status != STATUS_SUCCESS) return CO_RC(ERROR); *pages = sbi.NumberOfPhysicalPages; /* * Round to 16 MB boundars, since Windows doesn't return the * exact amount but a bit lower. */ *pages = ~0xfff & ((*pages) + 0xfff); return rc;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -