| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- /* include/kernel/mm.h
- *
- * This file is part of evx.
- *
- * evx is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * evx is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with evx. If not, see <https://www.gnu.org/licenses/>
- */
- #ifndef __MM_H
- #define __MM_H
- #ifndef __ASSEMBLER__
- #include <sys/types.h>
- #include <arch/archinfo.h>
- /* a descriptor for each page to describe a page, hopely be smallest
- * and this is create only for the buddy memory management system. we
- * can't implement that without this, because we need more memory when
- * inserting.
- *
- *
- * we should initiallize this as early as we can.
- * */
- struct page {
- /* number of this page */
- __archptr_t pnr;
- /* for cow, the reference count. we won't free if count-- */
- __uint32_t count;
- struct page *next;
- };
- /* okay, that's may only in the x86, but... */
- struct zone {
- __uint32_t total_pages;
- #define ZONETYPE_RAM 1
- #define ZONETYPE_OTHER 2
- __uint32_t type;
- void *start_addr;
-
- struct page *pages;
- };
- #endif
- #endif
|