#endif /* FEATURE(DEBUG) */
/*
- * Figure out if we should be using PAE paging or not. Besides looking at the amount of
- * available memory, the kernel should probably also see what cpuid has to say about PAE
- * availability. It's not unreasonable to expect PAE to be supported though, since it has
- * been around since the Pentium Pro (with the exception of some Pentium Ms).
+ * Figure out if we should be using PAE paging or not
*/
- if(mem_size < 0x100000000L) {
- /* we have less than 4G of memory, no need for PAE */
- _pg_flags = PG_MODE_LEGACY;
- } else {
- /* TODO: check if IA-32e paging is supported */
+ if(cpu_get_capabilities() & CPU_CAPABILITY_PAE) {
_pg_flags = PG_MODE_PAE;
+ } else {
+ _pg_flags = PG_MODE_LEGACY;
}
/*