Changes in / [b2fa2d86:8a26f82] in mainline
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/generic/include/memstr.h
rb2fa2d86 r8a26f82 36 36 37 37 extern void *memcpy(void *, const void *, size_t); 38 extern void *memset(void *, int, size_t);39 38 extern void *memmove(void *, const void *, size_t); 40 39 -
boot/generic/src/memstr.c
rb2fa2d86 r8a26f82 35 35 * memory areas cannot overlap. 36 36 * 37 * @param src 38 * @param dst 39 * @param cnt 37 * @param src Source address to copy from. 38 * @param dst Destination address to copy to. 39 * @param cnt Number of bytes to copy. 40 40 * 41 * @return Destination address. 42 * 41 * @return Destination address. 43 42 */ 44 43 void *memcpy(void *dst, const void *src, size_t cnt) 45 44 { 46 return __builtin_memcpy(dst, src, cnt); 47 } 45 size_t i; 48 46 49 /** Fill block of memory. 50 * 51 * Fill cnt bytes at dst address with the value val. 52 * 53 * @param dst Destination address to fill. 54 * @param val Value to fill. 55 * @param cnt Number of bytes to fill. 56 * 57 * @return Destination address. 58 * 59 */ 60 void *memset(void *dst, int val, size_t cnt) 61 { 62 return __builtin_memset(dst, val, cnt); 47 for (i = 0; i < cnt; i++) 48 ((uint8_t *) dst)[i] = ((uint8_t *) src)[i]; 49 50 return dst; 63 51 } 64 52 -
kernel/arch/amd64/src/mm/page.c
rb2fa2d86 r8a26f82 78 78 void page_fault(unsigned int n, istate_t *istate) 79 79 { 80 uintptr_t badvaddr= read_cr2();80 uintptr_t page = read_cr2(); 81 81 82 82 if (istate->error_word & PFERR_CODE_RSVD) … … 92 92 access = PF_ACCESS_READ; 93 93 94 (void) as_page_fault(badvaddr, access, istate);94 as_page_fault(page, access, istate); 95 95 } 96 96 -
kernel/arch/arm32/src/fpu_context.c
rb2fa2d86 r8a26f82 119 119 * rely on user decision to use CONFIG_FPU. 120 120 */ 121 #ifdef PROCESSOR_ARC H_armv7_a121 #ifdef PROCESSOR_ARC_armv7_a 122 122 const uint32_t cpacr = CPACR_read(); 123 123 /* FPU needs access to coprocessor 10 and 11. 124 * Moreover they need to have same access enabled */124 * Moreover they need to have same access enabledd */ 125 125 if (((cpacr & CPACR_CP_MASK(10)) != CPACR_CP_FULL_ACCESS(10)) && 126 126 ((cpacr & CPACR_CP_MASK(11)) != CPACR_CP_FULL_ACCESS(11))) { -
kernel/arch/ia32/src/mm/page.c
rb2fa2d86 r8a26f82 84 84 void page_fault(unsigned int n __attribute__((unused)), istate_t *istate) 85 85 { 86 uintptr_t badvaddr;86 uintptr_t page; 87 87 pf_access_t access; 88 88 89 badvaddr= read_cr2();89 page = read_cr2(); 90 90 91 91 if (istate->error_word & PFERR_CODE_RSVD) … … 97 97 access = PF_ACCESS_READ; 98 98 99 (void) as_page_fault(badvaddr, access, istate); 99 if (as_page_fault(page, access, istate) == AS_PF_FAULT) { 100 fault_if_from_uspace(istate, "Page fault: %#x.", page); 101 panic_memtrap(istate, access, page, NULL); 102 } 100 103 } 101 104 -
kernel/arch/mips32/src/mm/tlb.c
rb2fa2d86 r8a26f82 94 94 entry_lo_t lo; 95 95 uintptr_t badvaddr; 96 uintptr_t page; 96 97 pte_t *pte; 97 98 98 99 badvaddr = cp0_badvaddr_read(); 99 100 pte = page_mapping_find(AS, badvaddr, true); 100 page = ALIGN_DOWN(badvaddr, PAGE_SIZE); 101 102 pte = page_mapping_find(AS, page, true); 101 103 if (pte && pte->p) { 102 104 /* … … 123 125 } 124 126 125 (void) as_page_fault( badvaddr, PF_ACCESS_READ, istate);127 (void) as_page_fault(page, PF_ACCESS_READ, istate); 126 128 } 127 129 … … 135 137 tlb_index_t index; 136 138 uintptr_t badvaddr; 139 uintptr_t page; 137 140 pte_t *pte; 138 141 … … 158 161 159 162 badvaddr = cp0_badvaddr_read(); 160 161 pte = page_mapping_find(AS, badvaddr, true); 163 page = ALIGN_DOWN(badvaddr, PAGE_SIZE); 164 165 pte = page_mapping_find(AS, page, true); 162 166 if (pte && pte->p) { 163 167 /* … … 185 189 } 186 190 187 (void) as_page_fault( badvaddr, PF_ACCESS_READ, istate);191 (void) as_page_fault(page, PF_ACCESS_READ, istate); 188 192 } 189 193 … … 197 201 tlb_index_t index; 198 202 uintptr_t badvaddr; 203 uintptr_t page; 199 204 pte_t *pte; 200 205 201 206 badvaddr = cp0_badvaddr_read(); 207 page = ALIGN_DOWN(badvaddr, PAGE_SIZE); 202 208 203 209 /* … … 221 227 } 222 228 223 pte = page_mapping_find(AS, badvaddr, true);229 pte = page_mapping_find(AS, page, true); 224 230 if (pte && pte->p && pte->w) { 225 231 /* … … 248 254 } 249 255 250 (void) as_page_fault( badvaddr, PF_ACCESS_WRITE, istate);256 (void) as_page_fault(page, PF_ACCESS_WRITE, istate); 251 257 } 252 258 -
kernel/arch/sparc64/src/mm/sun4u/tlb.c
rb2fa2d86 r8a26f82 196 196 void fast_instruction_access_mmu_miss(sysarg_t unused, istate_t *istate) 197 197 { 198 uintptr_t page_16k = ALIGN_DOWN(istate->tpc, PAGE_SIZE); 198 199 size_t index = (istate->tpc >> MMU_PAGE_WIDTH) % MMU_PAGES_PER_PAGE; 199 200 pte_t *t; 200 201 201 t = page_mapping_find(AS, istate->tpc, true);202 t = page_mapping_find(AS, page_16k, true); 202 203 if (t && PTE_EXECUTABLE(t)) { 203 204 /* … … 215 216 * handler. 216 217 */ 217 as_page_fault( istate->tpc, PF_ACCESS_EXEC, istate);218 as_page_fault(page_16k, PF_ACCESS_EXEC, istate); 218 219 } 219 220 } -
kernel/generic/src/mm/as.c
rb2fa2d86 r8a26f82 544 544 mem_backend_data_t *backend_data, uintptr_t *base, uintptr_t bound) 545 545 { 546 if ((*base != (uintptr_t) -1) && !IS_ALIGNED(*base, PAGE_SIZE))546 if ((*base != (uintptr_t) -1) && ((*base % PAGE_SIZE) != 0)) 547 547 return NULL; 548 548 … … 688 688 int as_area_resize(as_t *as, uintptr_t address, size_t size, unsigned int flags) 689 689 { 690 if (!IS_ALIGNED(address, PAGE_SIZE))691 return EINVAL;692 693 690 mutex_lock(&as->lock); 694 691 … … 1353 1350 * Interrupts are assumed disabled. 1354 1351 * 1355 * @param address Faulting address.1356 * @param access 1357 * 1358 * @param istate 1352 * @param page Faulting page. 1353 * @param access Access mode that caused the page fault (i.e. 1354 * read/write/exec). 1355 * @param istate Pointer to the interrupted state. 1359 1356 * 1360 1357 * @return AS_PF_FAULT on page fault. … … 1364 1361 * 1365 1362 */ 1366 int as_page_fault(uintptr_t address, pf_access_t access, istate_t *istate) 1367 { 1368 uintptr_t page = ALIGN_DOWN(address, PAGE_SIZE); 1363 int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate) 1364 { 1369 1365 int rc = AS_PF_FAULT; 1370 1366 … … 1456 1452 task_kill_self(true); 1457 1453 } else { 1458 fault_if_from_uspace(istate, "Page fault: %p.", (void *) address);1459 panic_memtrap(istate, access, address, NULL);1454 fault_if_from_uspace(istate, "Page fault: %p.", (void *) page); 1455 panic_memtrap(istate, access, page, NULL); 1460 1456 } 1461 1457 … … 1683 1679 { 1684 1680 ASSERT(mutex_locked(&area->lock)); 1685 ASSERT( IS_ALIGNED(page, PAGE_SIZE));1681 ASSERT(page == ALIGN_DOWN(page, PAGE_SIZE)); 1686 1682 ASSERT(count); 1687 1683 … … 1967 1963 { 1968 1964 ASSERT(mutex_locked(&area->lock)); 1969 ASSERT( IS_ALIGNED(page, PAGE_SIZE));1965 ASSERT(page == ALIGN_DOWN(page, PAGE_SIZE)); 1970 1966 ASSERT(count); 1971 1967 -
kernel/generic/src/mm/backend_anon.c
rb2fa2d86 r8a26f82 173 173 * 174 174 * @param area Pointer to the address space area. 175 * @param upage Faulting virtual page.175 * @param addr Faulting virtual address. 176 176 * @param access Access mode that caused the fault (i.e. read/write/exec). 177 177 * … … 179 179 * serviced). 180 180 */ 181 int anon_page_fault(as_area_t *area, uintptr_t upage, pf_access_t access) 182 { 181 int anon_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access) 182 { 183 uintptr_t upage = ALIGN_DOWN(addr, PAGE_SIZE); 183 184 uintptr_t kpage; 184 185 uintptr_t frame; … … 186 187 ASSERT(page_table_locked(AS)); 187 188 ASSERT(mutex_locked(&area->lock)); 188 ASSERT(IS_ALIGNED(upage, PAGE_SIZE));189 189 190 190 if (!as_area_check_access(area, access)) -
kernel/generic/src/mm/backend_elf.c
rb2fa2d86 r8a26f82 235 235 * 236 236 * @param area Pointer to the address space area. 237 * @param upage Faulting virtual page.237 * @param addr Faulting virtual address. 238 238 * @param access Access mode that caused the fault (i.e. 239 239 * read/write/exec). … … 242 242 * on success (i.e. serviced). 243 243 */ 244 int elf_page_fault(as_area_t *area, uintptr_t upage, pf_access_t access)244 int elf_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access) 245 245 { 246 246 elf_header_t *elf = area->backend_data.elf; … … 250 250 uintptr_t frame; 251 251 uintptr_t kpage; 252 uintptr_t upage; 252 253 uintptr_t start_anon; 253 254 size_t i; … … 256 257 ASSERT(page_table_locked(AS)); 257 258 ASSERT(mutex_locked(&area->lock)); 258 ASSERT(IS_ALIGNED(upage, PAGE_SIZE));259 259 260 260 if (!as_area_check_access(area, access)) 261 261 return AS_PF_FAULT; 262 262 263 if ( upage< ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE))263 if (addr < ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) 264 264 return AS_PF_FAULT; 265 265 266 if ( upage>= entry->p_vaddr + entry->p_memsz)266 if (addr >= entry->p_vaddr + entry->p_memsz) 267 267 return AS_PF_FAULT; 268 268 269 i = ( upage- ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) >> PAGE_WIDTH;269 i = (addr - ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) >> PAGE_WIDTH; 270 270 base = (uintptr_t) 271 271 (((void *) elf) + ALIGN_DOWN(entry->p_offset, PAGE_SIZE)); 272 273 /* Virtual address of faulting page */ 274 upage = ALIGN_DOWN(addr, PAGE_SIZE); 272 275 273 276 /* Virtual address of the end of initialized part of segment */ -
kernel/generic/src/mm/backend_phys.c
rb2fa2d86 r8a26f82 111 111 * 112 112 * @param area Pointer to the address space area. 113 * @param upage Faulting virtual page.113 * @param addr Faulting virtual address. 114 114 * @param access Access mode that caused the fault (i.e. read/write/exec). 115 115 * … … 117 117 * serviced). 118 118 */ 119 int phys_page_fault(as_area_t *area, uintptr_t upage, pf_access_t access)119 int phys_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access) 120 120 { 121 121 uintptr_t base = area->backend_data.base; … … 123 123 ASSERT(page_table_locked(AS)); 124 124 ASSERT(mutex_locked(&area->lock)); 125 ASSERT(IS_ALIGNED(upage, PAGE_SIZE));126 125 127 126 if (!as_area_check_access(area, access)) 128 127 return AS_PF_FAULT; 129 128 130 ASSERT( upage- area->base < area->backend_data.frames * FRAME_SIZE);131 page_mapping_insert(AS, upage, base + (upage- area->base),129 ASSERT(addr - area->base < area->backend_data.frames * FRAME_SIZE); 130 page_mapping_insert(AS, addr, base + (addr - area->base), 132 131 as_area_get_flags(area)); 133 132 134 if (!used_space_insert(area, upage, 1))133 if (!used_space_insert(area, ALIGN_DOWN(addr, PAGE_SIZE), 1)) 135 134 panic("Cannot insert used space."); 136 135 -
kernel/generic/src/mm/page.c
rb2fa2d86 r8a26f82 104 104 ASSERT(page_mapping_operations->mapping_insert); 105 105 106 page_mapping_operations->mapping_insert(as, ALIGN_DOWN(page, PAGE_SIZE), 107 ALIGN_DOWN(frame, FRAME_SIZE), flags); 106 page_mapping_operations->mapping_insert(as, page, frame, flags); 108 107 109 108 /* Repel prefetched accesses to the old mapping. */ … … 128 127 ASSERT(page_mapping_operations->mapping_remove); 129 128 130 page_mapping_operations->mapping_remove(as, 131 ALIGN_DOWN(page, PAGE_SIZE)); 129 page_mapping_operations->mapping_remove(as, page); 132 130 133 131 /* Repel prefetched accesses to the old mapping. */ … … 152 150 ASSERT(page_mapping_operations->mapping_find); 153 151 154 return page_mapping_operations->mapping_find(as, 155 ALIGN_DOWN(page, PAGE_SIZE), nolock); 152 return page_mapping_operations->mapping_find(as, page, nolock); 156 153 } 157 154 -
kernel/generic/src/sysinfo/sysinfo.c
rb2fa2d86 r8a26f82 753 753 sysinfo_return_t ret; 754 754 ret.tag = SYSINFO_VAL_UNDEFINED; 755 ret.data.data = NULL;756 ret.data.size = 0;757 755 758 756 if (size > SYSINFO_MAX_PATH) -
tools/toolchain.sh
rb2fa2d86 r8a26f82 55 55 BINUTILS_VERSION="2.23.1" 56 56 BINUTILS_RELEASE="" 57 GCC_VERSION="4. 8.0"58 GDB_VERSION="7.5 .1"57 GCC_VERSION="4.7.2" 58 GDB_VERSION="7.5" 59 59 60 60 BASEDIR="`pwd`" … … 275 275 276 276 download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "33adb18c3048d057ac58d07a3f1adb38" 277 download_fetch "${GCC_SOURCE}" "${GCC}" " e6040024eb9e761c3bea348d1fa5abb0"278 download_fetch "${GDB_SOURCE}" "${GDB}" " 3f48f468b24447cf24820054ff6e85b1"277 download_fetch "${GCC_SOURCE}" "${GCC}" "cc308a0891e778cfda7a151ab8a6e762" 278 download_fetch "${GDB_SOURCE}" "${GDB}" "24a6779a9fe0260667710de1b082ef61" 279 279 } 280 280 -
uspace/srv/fs/exfat/exfat_fat.c
rb2fa2d86 r8a26f82 401 401 { 402 402 service_id_t service_id = nodep->idx->service_id; 403 exfat_cluster_t lastc = 0;403 exfat_cluster_t lastc; 404 404 int rc; 405 405 -
uspace/srv/fs/fat/fat_fat.c
rb2fa2d86 r8a26f82 128 128 { 129 129 fat_cluster_t firstc = nodep->firstc; 130 fat_cluster_t currc = 0;130 fat_cluster_t currc; 131 131 aoff64_t relbn = bn; 132 132 int rc; … … 194 194 uint32_t clusters; 195 195 uint32_t max_clusters; 196 fat_cluster_t c = 0;196 fat_cluster_t c; 197 197 int rc; 198 198 … … 679 679 fat_cluster_t *lifo; /* stack for storing free cluster numbers */ 680 680 unsigned found = 0; /* top of the free cluster number stack */ 681 fat_cluster_t clst; 682 fat_cluster_t value = 0; 683 fat_cluster_t clst_last1 = FAT_CLST_LAST1(bs); 681 fat_cluster_t clst, value, clst_last1 = FAT_CLST_LAST1(bs); 684 682 int rc = EOK; 685 683 … … 785 783 { 786 784 service_id_t service_id = nodep->idx->service_id; 787 fat_cluster_t lastc = 0;785 fat_cluster_t lastc; 788 786 uint8_t fatno; 789 787 int rc; … … 909 907 int fat_sanity_check(fat_bs_t *bs, service_id_t service_id) 910 908 { 911 fat_cluster_t e0 = 0; 912 fat_cluster_t e1 = 0; 909 fat_cluster_t e0, e1; 913 910 unsigned fat_no; 914 911 int rc; -
uspace/srv/fs/mfs/mfs_ops.c
rb2fa2d86 r8a26f82 773 773 { 774 774 int rc; 775 fs_node_t *fn = NULL;775 fs_node_t *fn; 776 776 777 777 rc = mfs_node_get(&fn, service_id, index); … … 1108 1108 mfs_sync(service_id_t service_id, fs_index_t index) 1109 1109 { 1110 fs_node_t *fn = NULL;1110 fs_node_t *fn; 1111 1111 int rc = mfs_node_get(&fn, service_id, index); 1112 1112 if (rc != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.