Changeset f5dd4a1 in mainline
- Timestamp:
- 2019-03-31T16:44:21Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f27e21d
- Parents:
- 68d8736
- Location:
- kernel/arch/mips32
- Files:
-
- 1 deleted
- 6 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/Makefile.inc
r68d8736 rf5dd4a1 70 70 arch/$(KARCH)/src/machine_func.c 71 71 72 ifeq ($(MACHINE),msim)73 ARCH_SOURCES += \74 arch/$(KARCH)/src/smp/dorder.c75 endif76 77 72 ifeq ($(MACHINE),$(filter lmalta bmalta,$(MACHINE))) 78 73 ARCH_SOURCES += arch/$(KARCH)/src/mach/malta/malta.c … … 80 75 81 76 ifeq ($(MACHINE),msim) 82 ARCH_SOURCES += arch/$(KARCH)/src/mach/msim/msim.c 77 ARCH_SOURCES += \ 78 arch/$(KARCH)/src/mach/msim/msim.c \ 79 arch/$(KARCH)/src/mach/msim/dorder.c 83 80 endif 84 81 -
kernel/arch/mips32/include/arch/mach/msim/dorder.h
r68d8736 rf5dd4a1 38 38 #include <stdint.h> 39 39 40 extern void dorder_init(void); 40 41 extern uint32_t dorder_cpuid(void); 41 42 extern void dorder_ipi_ack(uint32_t); -
kernel/arch/mips32/include/arch/mach/msim/msim.h
r68d8736 rf5dd4a1 38 38 39 39 #include <arch/machine_func.h> 40 #include <arch/mm/page.h> 41 42 /** Address of devices. */ 43 #define MSIM_VIDEORAM PA2KSEG1(0x10000000) 44 #define MSIM_KBD_ADDRESS PA2KSEG1(0x10000000) 45 #define MSIM_DORDER_ADDRESS PA2KSEG1(0x10000100) 46 47 #define MSIM_KBD_IRQ 2 48 #define MSIM_DORDER_IRQ 5 49 #define MSIM_DDISK_IRQ 6 40 50 41 51 extern struct mips32_machine_ops msim_machine_ops; -
kernel/arch/mips32/include/arch/mm/page.h
r68d8736 rf5dd4a1 43 43 44 44 #ifndef __ASSEMBLER__ 45 # define KSEG12PA(x) (((uintptr_t) (x)) - 0xa0000000) 45 46 # define PA2KSEG1(x) (((uintptr_t) (x)) + 0xa0000000) 46 47 # define KA2PA(x) (((uintptr_t) (x)) - 0x80000000) -
kernel/arch/mips32/src/interrupt.c
r68d8736 rf5dd4a1 38 38 #include <arch.h> 39 39 #include <arch/cp0.h> 40 #include <arch/smp/dorder.h>41 40 #include <time/clock.h> 42 41 #include <ipc/sysipc.h> … … 45 44 #define TIMER_IRQ 7 46 45 47 #ifdef MACHINE_msim48 #define DORDER_IRQ 549 #endif50 51 46 function virtual_timer_fnc = NULL; 52 47 static irq_t timer_irq; 53 54 #ifdef MACHINE_msim55 static irq_t dorder_irq;56 #endif57 48 58 49 // TODO: This is SMP unsafe!!! … … 156 147 } 157 148 158 #ifdef MACHINE_msim159 static irq_ownership_t dorder_claim(irq_t *irq)160 {161 return IRQ_ACCEPT;162 }163 164 static void dorder_irq_handler(irq_t *irq)165 {166 dorder_ipi_ack(1 << dorder_cpuid());167 }168 #endif169 170 149 /* Initialize basic tables for exception dispatching */ 171 150 void interrupt_init(void) … … 181 160 timer_start(); 182 161 cp0_unmask_int(TIMER_IRQ); 183 184 #ifdef MACHINE_msim185 irq_initialize(&dorder_irq);186 dorder_irq.inr = DORDER_IRQ;187 dorder_irq.claim = dorder_claim;188 dorder_irq.handler = dorder_irq_handler;189 irq_register(&dorder_irq);190 191 cp0_unmask_int(DORDER_IRQ);192 #endif193 162 } 194 163 -
kernel/arch/mips32/src/mach/msim/dorder.c
r68d8736 rf5dd4a1 33 33 */ 34 34 35 #include <arch/mach/msim/dorder.h> 36 #include <arch/mach/msim/msim.h> 35 37 #include <stdint.h> 36 38 #include <smp/ipi.h> 37 #include < arch/smp/dorder.h>39 #include <interrupt.h> 38 40 39 #define MSIM_DORDER_ADDRESS 0xB0000100 41 static irq_t dorder_irq; 40 42 41 43 #ifdef CONFIG_SMP … … 47 49 48 50 #endif 51 52 static irq_ownership_t dorder_claim(irq_t *irq) 53 { 54 return IRQ_ACCEPT; 55 } 56 57 static void dorder_irq_handler(irq_t *irq) 58 { 59 dorder_ipi_ack(1 << dorder_cpuid()); 60 } 61 62 void dorder_init(void) 63 { 64 irq_initialize(&dorder_irq); 65 dorder_irq.inr = MSIM_DORDER_IRQ; 66 dorder_irq.claim = dorder_claim; 67 dorder_irq.handler = dorder_irq_handler; 68 irq_register(&dorder_irq); 69 70 cp0_unmask_int(MSIM_DORDER_IRQ); 71 } 49 72 50 73 uint32_t dorder_cpuid(void) -
kernel/arch/mips32/src/mach/msim/msim.c
r68d8736 rf5dd4a1 35 35 36 36 #include <arch/mach/msim/msim.h> 37 #include <arch/mach/msim/dorder.h> 37 38 #include <console/console.h> 38 39 #include <sysinfo/sysinfo.h> 39 #include <arch/drivers/msim.h>40 40 #include <genarch/drivers/dsrln/dsrlnin.h> 41 41 #include <genarch/drivers/dsrln/dsrlnout.h> … … 62 62 void msim_init(void) 63 63 { 64 dorder_init(); 64 65 cp0_unmask_int(MSIM_DDISK_IRQ); 65 66 } -
kernel/arch/mips32/src/mm/frame.c
r68d8736 rf5dd4a1 41 41 #include <config.h> 42 42 #ifdef MACHINE_msim 43 #include <arch/ drivers/msim.h>43 #include <arch/mach/msim/msim.h> 44 44 #endif 45 45 #include <arch/arch.h> … … 57 57 58 58 #define ZERO_PAGE_VALUE_KSEG1(frame) \ 59 (((volatile uint32_t *) (0xa0000000 + (frame << ZERO_PAGE_WIDTH)))[ZERO_PAGE_OFFSET])59 (((volatile uint32_t *) PA2KSEG1(frame << ZERO_PAGE_WIDTH))[ZERO_PAGE_OFFSET]) 60 60 61 61 #define MAX_REGIONS 32 … … 80 80 #ifdef MACHINE_msim 81 81 /* MSIM device (dprinter) */ 82 if (frame == (K A2PA(MSIM_VIDEORAM) >> ZERO_PAGE_WIDTH))82 if (frame == (KSEG12PA(MSIM_VIDEORAM) >> ZERO_PAGE_WIDTH)) 83 83 return false; 84 84 85 85 /* MSIM device (dkeyboard) */ 86 if (frame == (K A2PA(MSIM_KBD_ADDRESS) >> ZERO_PAGE_WIDTH))86 if (frame == (KSEG12PA(MSIM_KBD_ADDRESS) >> ZERO_PAGE_WIDTH)) 87 87 return false; 88 88 #endif
Note:
See TracChangeset
for help on using the changeset viewer.