Changeset de96d3b in mainline
- Timestamp:
- 2024-01-03T16:54:15Z (12 months ago)
- Branches:
- master, topic/simplify-dev-export
- Children:
- 00e6288, 25e1490
- Parents:
- 7130754
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-01-01 04:12:52)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-01-03 16:54:15)
- Location:
- kernel
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/arch/mm/page.h
r7130754 rde96d3b 192 192 unsigned int accessed : 1; 193 193 unsigned int dirty : 1; 194 unsigned int unused: 1;194 unsigned int pat : 1; 195 195 unsigned int global : 1; 196 196 unsigned int soft_valid : 1; /**< Valid content even if present bit is cleared. */ … … 211 211 p->writeable << PAGE_WRITE_SHIFT | 212 212 (!p->no_execute) << PAGE_EXEC_SHIFT | 213 p->global << PAGE_GLOBAL_SHIFT); 213 p->global << PAGE_GLOBAL_SHIFT | 214 p->page_write_through << PAGE_WRITE_COMBINE_SHIFT); 214 215 } 215 216 … … 225 226 pte_t *p = &pt[i]; 226 227 227 p->page_cache_disable = !(flags & PAGE_CACHEABLE);228 228 p->present = !(flags & PAGE_NOT_PRESENT); 229 229 p->uaccessible = (flags & PAGE_USER) != 0; … … 232 232 p->global = (flags & PAGE_GLOBAL) != 0; 233 233 234 if (flags & PAGE_WRITE_COMBINE) { 235 /* We have mapped PCD+PWT bits to write-combine mode via PAT MSR. */ 236 /* (If PAT is unsupported, it will default to uncached.) */ 237 p->page_cache_disable = 1; 238 p->page_write_through = 1; 239 } else { 240 p->page_cache_disable = !(flags & PAGE_CACHEABLE); 241 p->page_write_through = 0; 242 } 243 234 244 /* 235 245 * Ensure that there is at least one bit set even if the present bit is cleared. -
kernel/arch/amd64/src/amd64.c
r7130754 rde96d3b 60 60 #include <arch/vreg.h> 61 61 #include <arch/kseg.h> 62 #include <arch/mm/pat.h> 62 63 #include <genarch/pic/pic_ops.h> 63 64 … … 115 116 /* Disable alignment check */ 116 117 write_cr0(read_cr0() & ~CR0_AM); 118 119 /* Use PCD+PWT bit combination in PTE to mean write-combining mode. */ 120 if (pat_supported()) 121 pat_set_mapping(false, true, true, PAT_TYPE_WRITE_COMBINING); 117 122 118 123 if (config.cpu_active == 1) { -
kernel/arch/ia32/include/arch/mm/page.h
r7130754 rde96d3b 190 190 p->writeable << PAGE_WRITE_SHIFT | 191 191 1 << PAGE_EXEC_SHIFT | 192 p->global << PAGE_GLOBAL_SHIFT); 192 p->global << PAGE_GLOBAL_SHIFT | 193 p->page_write_through << PAGE_WRITE_COMBINE_SHIFT); 193 194 } 194 195 … … 197 198 pte_t *p = &pt[i]; 198 199 199 p->page_cache_disable = !(flags & PAGE_CACHEABLE);200 200 p->present = !(flags & PAGE_NOT_PRESENT); 201 201 p->uaccessible = (flags & PAGE_USER) != 0; 202 202 p->writeable = (flags & PAGE_WRITE) != 0; 203 203 p->global = (flags & PAGE_GLOBAL) != 0; 204 205 if (flags & PAGE_WRITE_COMBINE) { 206 /* We have mapped PCD+PWT bits to write-combine mode via PAT MSR. */ 207 /* (If PAT is unsupported, it will default to uncached.) */ 208 p->page_cache_disable = 1; 209 p->page_write_through = 1; 210 } else { 211 p->page_cache_disable = !(flags & PAGE_CACHEABLE); 212 p->page_write_through = 0; 213 } 204 214 205 215 /* -
kernel/arch/ia32/src/ia32.c
r7130754 rde96d3b 61 61 #include <arch/pm.h> 62 62 #include <arch/vreg.h> 63 #include <arch/mm/pat.h> 63 64 64 65 #ifdef CONFIG_SMP … … 104 105 { 105 106 pm_init(); 107 108 /* Use PCD+PWT bit combination in PTE to mean write-combining mode. */ 109 if (pat_supported()) 110 pat_set_mapping(false, true, true, PAT_TYPE_WRITE_COMBINING); 106 111 107 112 if (config.cpu_active == 1) { -
kernel/genarch/src/fb/fb.c
r7130754 rde96d3b 633 633 634 634 instance->addr = (uint8_t *) km_map((uintptr_t) props->addr, fbsize, 635 KM_NATURAL_ALIGNMENT, PAGE_WRITE | PAGE_ NOT_CACHEABLE);635 KM_NATURAL_ALIGNMENT, PAGE_WRITE | PAGE_WRITE_COMBINE); 636 636 if (!instance->addr) { 637 637 LOG("Unable to map framebuffer."); -
kernel/generic/include/mm/mm.h
r7130754 rde96d3b 46 46 #define PAGE_EXEC_SHIFT 5 47 47 #define PAGE_GLOBAL_SHIFT 6 48 #define PAGE_WRITE_COMBINE_SHIFT 7 48 49 49 50 #define PAGE_NOT_CACHEABLE (0 << PAGE_CACHEABLE_SHIFT) … … 62 63 #define PAGE_GLOBAL (1 << PAGE_GLOBAL_SHIFT) 63 64 65 #define PAGE_WRITE_COMBINE (1 << PAGE_WRITE_COMBINE_SHIFT) 66 64 67 #endif 65 68
Note:
See TracChangeset
for help on using the changeset viewer.