| 912 | } |
| 913 | |
| 914 | void rt_hw_mem_setup_early(unsigned long *tbl0, unsigned long *tbl1, |
| 915 | unsigned long size, unsigned long pv_off) |
| 916 | { |
| 917 | int ret; |
| 918 | unsigned long count = (size + ARCH_SECTION_MASK) >> ARCH_SECTION_SHIFT; |
| 919 | unsigned long normal_attr = MMU_MAP_K_RWCB; |
| 920 | extern unsigned char _start; |
| 921 | unsigned long va = (unsigned long) &_start - pv_off; |
| 922 | va = RT_ALIGN_DOWN(va, 0x200000); |
| 923 | |
| 924 | /* setup pv off */ |
| 925 | rt_kmem_pvoff_set(pv_off); |
| 926 | |
| 927 | /* clean the first two pages */ |
| 928 | rt_memset((char *)tbl0, 0, ARCH_PAGE_SIZE); |
| 929 | rt_memset((char *)tbl1, 0, ARCH_PAGE_SIZE); |
| 930 | |
| 931 | ret = _init_map_2M(tbl1, va, va + pv_off, count, normal_attr); |
| 932 | if (ret != 0) |
| 933 | { |
| 934 | while (1); |
| 935 | } |
| 936 | ret = _init_map_2M(tbl0, va + pv_off, va + pv_off, count, normal_attr); |
| 937 | if (ret != 0) |
| 938 | { |
| 939 | while (1); |
| 940 | } |
| 941 | } |
| 942 | |
| 943 | void *rt_hw_mmu_pgtbl_create(void) |
| 944 | { |
nothing calls this directly
no test coverage detected