Changeset 00aece0 in mainline for kernel/arch/mips32/src


Ignore:
Timestamp:
2012-02-18T16:47:38Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4449c6c
Parents:
bd5f3b7 (diff), f943dd3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Location:
kernel/arch/mips32/src
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/src/mips32.c

    rbd5f3b7 r00aece0  
    3434
    3535#include <arch.h>
    36 #include <arch/cp0.h>
    37 #include <arch/exception.h>
    38 #include <arch/debug.h>
    39 #include <mm/as.h>
     36#include <typedefs.h>
     37#include <errno.h>
     38#include <interrupt.h>
     39#include <macros.h>
     40#include <str.h>
     41#include <memstr.h>
    4042#include <userspace.h>
    41 #include <memstr.h>
    42 #include <proc/thread.h>
    43 #include <abi/proc/uarg.h>
    44 #include <print.h>
    4543#include <console/console.h>
    4644#include <syscall/syscall.h>
    4745#include <sysinfo/sysinfo.h>
    48 #include <arch/interrupt.h>
    49 #include <interrupt.h>
    50 #include <console/chardev.h>
    51 #include <arch/barrier.h>
     46#include <arch/debug.h>
    5247#include <arch/debugger.h>
     48#include <arch/drivers/msim.h>
    5349#include <genarch/fb/fb.h>
    54 #include <abi/fb/visuals.h>
    5550#include <genarch/drivers/dsrln/dsrlnin.h>
    5651#include <genarch/drivers/dsrln/dsrlnout.h>
    5752#include <genarch/srln/srln.h>
    58 #include <macros.h>
    59 #include <config.h>
    60 #include <str.h>
    61 #include <arch/drivers/msim.h>
    62 #include <arch/asm/regname.h>
    6353
    6454/* Size of the code jumping to the exception handler code
     
    8878        size_t i;
    8979        for (i = 0; i < init.cnt; i++) {
    90                 init.tasks[i].addr = (uintptr_t) bootinfo->tasks[i].addr;
     80                init.tasks[i].paddr = KA2PA(bootinfo->tasks[i].addr);
    9181                init.tasks[i].size = bootinfo->tasks[i].size;
    9282                str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN,
     
    206196        sysinfo_set_item_val("kbd", NULL, true);
    207197        sysinfo_set_item_val("kbd.inr", NULL, MSIM_KBD_IRQ);
    208         sysinfo_set_item_val("kbd.address.virtual", NULL, MSIM_KBD_ADDRESS);
     198        sysinfo_set_item_val("kbd.address.physical", NULL,
     199            PA2KA(MSIM_KBD_ADDRESS));
    209200#endif
    210201}
     
    248239 * possible to have it separately in the future.
    249240 */
    250 sysarg_t sys_tls_set(sysarg_t addr)
    251 {
    252         return 0;
     241sysarg_t sys_tls_set(uintptr_t addr)
     242{
     243        return EOK;
    253244}
    254245
  • kernel/arch/mips32/src/mm/frame.c

    rbd5f3b7 r00aece0  
    123123        for (i = 0; i < init.cnt; i++)
    124124                if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE,
    125                     KA2PA(init.tasks[i].addr), init.tasks[i].size)) {
     125                    init.tasks[i].paddr, init.tasks[i].size)) {
    126126                        safe = false;
    127127                        break;
     
    131131}
    132132
    133 static void frame_add_region(pfn_t start_frame, pfn_t end_frame)
    134 {
    135         if (end_frame > start_frame) {
    136                 /* Convert 1M frames to 16K frames */
    137                 pfn_t first = ADDR2PFN(start_frame << ZERO_PAGE_WIDTH);
    138                 pfn_t count = ADDR2PFN((end_frame - start_frame) << ZERO_PAGE_WIDTH);
    139                
     133static void frame_add_region(pfn_t start_frame, pfn_t end_frame, bool low)
     134{
     135        if (end_frame <= start_frame)
     136                return;
     137
     138        uintptr_t base = start_frame << ZERO_PAGE_WIDTH;
     139        size_t size = (end_frame - start_frame) << ZERO_PAGE_WIDTH;
     140
     141        if (!frame_adjust_zone_bounds(low, &base, &size))
     142                return;
     143
     144        pfn_t first = ADDR2PFN(base);
     145        size_t count = SIZE2FRAMES(size);
     146        pfn_t conf_frame;
     147
     148        if (low) {
    140149                /* Interrupt vector frame is blacklisted */
    141                 pfn_t conf_frame;
    142150                if (first == 0)
    143151                        conf_frame = 1;
    144152                else
    145153                        conf_frame = first;
    146                
    147                 zone_create(first, count, conf_frame, 0);
    148                
    149                 if (phys_regions_count < MAX_REGIONS) {
    150                         phys_regions[phys_regions_count].start = first;
    151                         phys_regions[phys_regions_count].count = count;
    152                         phys_regions_count++;
    153                 }
     154                zone_create(first, count, conf_frame,
     155                    ZONE_AVAILABLE | ZONE_LOWMEM);
     156        } else {
     157                conf_frame = zone_external_conf_alloc(count);
     158                if (conf_frame != 0)
     159                        zone_create(first, count, conf_frame,
     160                            ZONE_AVAILABLE | ZONE_HIGHMEM);
     161        }
     162       
     163        if (phys_regions_count < MAX_REGIONS) {
     164                phys_regions[phys_regions_count].start = first;
     165                phys_regions[phys_regions_count].count = count;
     166                phys_regions_count++;
    154167        }
    155168}
     
    165178 *
    166179 */
    167 void frame_arch_init(void)
     180void frame_low_arch_init(void)
    168181{
    169182        ipl_t ipl = interrupts_disable();
     
    224237               
    225238                if (!avail) {
    226                         frame_add_region(start_frame, frame);
     239                        frame_add_region(start_frame, frame, true);
    227240                        start_frame = frame + 1;
    228241                        avail = true;
     
    230243        }
    231244       
    232         frame_add_region(start_frame, frame);
     245        frame_add_region(start_frame, frame, true);
    233246       
    234247        /* Blacklist interrupt vector frame */
     
    246259}
    247260
     261void frame_high_arch_init(void)
     262{
     263}
    248264
    249265void physmem_print(void)
  • kernel/arch/mips32/src/mm/page.c

    rbd5f3b7 r00aece0  
    4141{
    4242        page_mapping_operations = &pt_mapping_operations;
    43 }
    44 
    45 /** Map device into kernel space
    46  * - on mips, all devices are already mapped into kernel space,
    47  *   translate the physical address to uncached area
    48  */
    49 uintptr_t hw_map(uintptr_t physaddr, size_t size)
    50 {
    51         return physaddr + 0xa0000000;
     43        as_switch(NULL, AS_KERNEL);
    5244}
    5345
  • kernel/arch/mips32/src/mm/tlb.c

    rbd5f3b7 r00aece0  
    9595       
    9696        badvaddr = cp0_badvaddr_read();
    97        
    98         mutex_lock(&AS->lock);
    9997        asid = AS->asid;
    100         mutex_unlock(&AS->lock);
    10198       
    10299        pte = find_mapping_and_check(badvaddr, PF_ACCESS_READ, istate, &pfrc);
Note: See TracChangeset for help on using the changeset viewer.