Changeset b26396e in mainline for kernel


Ignore:
Timestamp:
2012-12-29T22:16:16Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
26e550c2
Parents:
ce60be1 (diff), b55877d (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:

Mainline changes

Location:
kernel
Files:
6 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/Makefile.inc

    rce60be1 rb26396e  
    7676        arch/$(KARCH)/src/proc/thread.c \
    7777        arch/$(KARCH)/src/userspace.c \
    78         arch/$(KARCH)/src/syscall.c \
    79         arch/$(KARCH)/src/debugger.c
     78        arch/$(KARCH)/src/syscall.c
    8079
    8180ifeq ($(CONFIG_SMP),y)
  • kernel/arch/amd64/src/amd64.c

    rce60be1 rb26396e  
    4343#include <arch/bios/bios.h>
    4444#include <arch/boot/boot.h>
    45 #include <arch/debugger.h>
    4645#include <arch/drivers/i8254.h>
    4746#include <arch/drivers/i8259.h>
     
    161160#endif
    162161               
    163                 /* Enable debugger */
    164                 debugger_init();
    165162                /* Merge all memory zones to 1 big zone */
    166163                zone_merge_all();
  • kernel/arch/amd64/src/fpu_context.c

    rce60be1 rb26396e  
    5757{
    5858        /* TODO: Zero all SSE, MMX etc. registers */
     59        /* Default value of SCR register is 0x1f80,
     60         * it masks all FPU exceptions*/
    5961        asm volatile (
    6062                "fninit\n"
  • kernel/arch/arm32/Makefile.inc

    rce60be1 rb26396e  
    5252        arch/$(KARCH)/src/machine_func.c \
    5353        arch/$(KARCH)/src/context.S \
    54         arch/$(KARCH)/src/fpu_context.c \
    5554        arch/$(KARCH)/src/dummy.S \
    5655        arch/$(KARCH)/src/cpu/cpu.c \
     
    6968        arch/$(KARCH)/src/ras.c
    7069
     70ifeq ($(CONFIG_FPU),y)
     71        ARCH_SOURCES += arch/$(KARCH)/src/fpu_context.c
     72endif
     73
    7174ifeq ($(MACHINE),gta02)
    7275        ARCH_SOURCES += arch/$(KARCH)/src/mach/gta02/gta02.c
    73 endif
    74 
    75 ifeq ($(MACHINE),testarm)
    76         ARCH_SOURCES += arch/$(KARCH)/src/mach/testarm/testarm.c
    7776endif
    7877
  • kernel/arch/arm32/include/fpu_context.h

    rce60be1 rb26396e  
    3131 */
    3232/** @file
    33  *  @brief FPU context (not implemented).
    34  *
    35  *  GXemul doesn't support FPU on its ARM CPU.
     33 *  @brief FPU context.
    3634 */
    3735
  • kernel/arch/arm32/src/exception.c

    rce60be1 rb26396e  
    167167static void undef_insn_exception(unsigned int exc_no, istate_t *istate)
    168168{
    169         if (!handle_if_fpu_exception()) {
    170                 fault_if_from_uspace(istate, "Undefined instruction.");
    171                 panic_badtrap(istate, exc_no, "Undefined instruction.");
    172         } else {
     169#ifdef CONFIG_FPU
     170        if (handle_if_fpu_exception()) {
    173171                /*
    174172                 * Retry the failing instruction,
     
    177175                 */
    178176                istate->pc -= 4;
     177                return;
    179178        }
     179#endif
     180        fault_if_from_uspace(istate, "Undefined instruction.");
     181        panic_badtrap(istate, exc_no, "Undefined instruction.");
    180182}
    181183
  • kernel/arch/arm32/src/mach/gta02/gta02.c

    rce60be1 rb26396e  
    2727 */
    2828
    29 /** @addtogroup arm32gxemul
     29/** @addtogroup arm32gta02
    3030 * @{
    3131 */
  • kernel/arch/arm32/src/machine_func.c

    rce60be1 rb26396e  
    4141#include <arch/mach/gta02/gta02.h>
    4242#include <arch/mach/integratorcp/integratorcp.h>
    43 #include <arch/mach/testarm/testarm.h>
    4443#include <arch/mach/beagleboardxm/beagleboardxm.h>
    4544
     
    5251#if defined(MACHINE_gta02)
    5352        machine_ops = &gta02_machine_ops;
    54 #elif defined(MACHINE_testarm)
    55         machine_ops = &gxemul_machine_ops;
    5653#elif defined(MACHINE_integratorcp)
    5754        machine_ops = &icp_machine_ops;
  • kernel/arch/arm32/src/ras.c

    rce60be1 rb26396e  
    6767void ras_check(unsigned int n, istate_t *istate)
    6868{
    69         bool restart = false;
     69        bool restart_needed = false;
     70        uintptr_t restart_pc = 0;
    7071
    7172        if (istate_from_uspace(istate)) {
     
    7374                        if ((ras_page[RAS_START] < istate->pc) &&
    7475                            (ras_page[RAS_END] > istate->pc)) {
    75                                 restart = true;
     76                                restart_needed = true;
     77                                restart_pc = ras_page[RAS_START];
    7678                        }
    7779                        ras_page[RAS_START] = 0;
     
    8183
    8284        exc_dispatch(n, istate);
    83         if (restart)
    84                 istate->pc = ras_page[RAS_START];
     85        if (restart_needed)
     86                istate->pc = restart_pc;
    8587}
    8688
  • kernel/arch/ia32/Makefile.inc

    rce60be1 rb26396e  
    105105        arch/$(KARCH)/src/boot/memmap.c \
    106106        arch/$(KARCH)/src/fpu_context.c \
    107         arch/$(KARCH)/src/debugger.c \
    108107        arch/$(KARCH)/src/syscall.c
  • kernel/arch/ia32/src/fpu_context.c

    rce60be1 rb26396e  
    3737#include <arch.h>
    3838#include <cpu.h>
     39
     40
     41/** x87 FPU scr values (P3+ MMX2) */
     42enum {
     43        X87_FLUSH_ZERO_FLAG = (1 << 15),
     44        X87_ROUND_CONTROL_MASK = (0x3 << 13),
     45        x87_ROUND_TO_NEAREST_EVEN = (0x0 << 13),
     46        X87_ROUND_DOWN_TO_NEG_INF = (0x1 << 13),
     47        X87_ROUND_UP_TO_POS_INF = (0x2 << 13),
     48        X87_ROUND_TO_ZERO = (0x3 << 13),
     49        X87_PRECISION_MASK = (1 << 12),
     50        X87_UNDERFLOW_MASK = (1 << 11),
     51        X87_OVERFLOW_MASK = (1 << 10),
     52        X87_ZERO_DIV_MASK = (1 << 9),
     53        X87_DENORMAL_OP_MASK = (1 << 8),
     54        X87_INVALID_OP_MASK = (1 << 7),
     55        X87_DENOM_ZERO_FLAG = (1 << 6),
     56        X87_PRECISION_EXC_FLAG = (1 << 5),
     57        X87_UNDERFLOW_EXC_FLAG = (1 << 4),
     58        X87_OVERFLOW_EXC_FLAG = (1 << 3),
     59        X87_ZERO_DIV_EXC_FLAG = (1 << 2),
     60        X87_DENORMAL_EXC_FLAG = (1 << 1),
     61        X87_INVALID_OP_EXC_FLAG = (1 << 0),
     62
     63        X87_ALL_MASK = X87_PRECISION_MASK | X87_UNDERFLOW_MASK | X87_OVERFLOW_MASK | X87_ZERO_DIV_MASK | X87_DENORMAL_OP_MASK | X87_INVALID_OP_MASK,
     64};
     65
    3966
    4067typedef void (*fpu_context_function)(fpu_context_t *fctx);
     
    98125}
    99126
     127/** Initialize x87 FPU. Mask all exceptions. */
    100128void fpu_init()
    101129{
     
    111139                "ldmxcsr %[help0]\n"
    112140                : [help0] "+m" (help0), [help1] "+r" (help1)
    113                 : [magic] "i" (0x1f80)
     141                : [magic] "i" (X87_ALL_MASK)
    114142        );
    115143}
  • kernel/arch/ia32/src/ia32.c

    rce60be1 rb26396e  
    4545#include <arch/bios/bios.h>
    4646#include <arch/boot/boot.h>
    47 #include <arch/debugger.h>
    4847#include <arch/drivers/i8254.h>
    4948#include <arch/drivers/i8259.h>
     
    118117#endif
    119118               
    120                 /* Enable debugger */
    121                 debugger_init();
    122119                /* Merge all memory zones to 1 big zone */
    123120                zone_merge_all();
  • kernel/arch/mips32/include/mm/tlb.h

    rce60be1 rb26396e  
    112112#ifdef __BE__
    113113                unsigned p : 1;
    114                 unsigned : 27;
    115                 unsigned index : 4;
     114                unsigned : 25;
     115                unsigned index : 6;
    116116#else
    117                 unsigned index : 4;
    118                 unsigned : 27;
     117                unsigned index : 6;
     118                unsigned : 25;
    119119                unsigned p : 1;
    120120#endif
  • kernel/generic/include/console/console.h

    rce60be1 rb26396e  
    6767extern wchar_t getc(indev_t *indev);
    6868extern size_t gets(indev_t *indev, char *buf, size_t buflen);
    69 extern sysarg_t sys_klog(int fd, const void *buf, size_t size);
     69extern sysarg_t sys_klog(int cmd, const void *buf, size_t size);
    7070
    7171extern void grab_console(void);
  • kernel/generic/src/console/console.c

    rce60be1 rb26396e  
    5252#include <errno.h>
    5353#include <str.h>
     54#include <abi/klog.h>
    5455
    5556#define KLOG_PAGES    8
     
    335336 *
    336337 */
    337 sysarg_t sys_klog(int fd, const void *buf, size_t size)
     338sysarg_t sys_klog(int cmd, const void *buf, size_t size)
    338339{
    339340        char *data;
    340341        int rc;
    341        
     342
     343        switch (cmd) {
     344        case KLOG_UPDATE:
     345                klog_update(NULL);
     346                return EOK;
     347        case KLOG_WRITE:
     348        case KLOG_COMMAND:
     349                break;
     350        default:
     351                return ENOTSUP;
     352        }
     353
    342354        if (size > PAGE_SIZE)
    343355                return (sysarg_t) ELIMIT;
     
    355367                data[size] = 0;
    356368               
    357                 printf("%s", data);
     369                switch (cmd) {
     370                case KLOG_WRITE:
     371                        printf("%s", data);
     372                        break;
     373                case KLOG_COMMAND:
     374                        if (!stdin)
     375                                break;
     376                        for (unsigned int i = 0; i < size; i++)
     377                                indev_push_character(stdin, data[i]);
     378                        indev_push_character(stdin, '\n');
     379                        break;
     380                }
     381
    358382                free(data);
    359         } else
    360                 klog_update(NULL);
    361        
     383        }
     384
    362385        return size;
    363386}
  • kernel/generic/src/proc/scheduler.c

    rce60be1 rb26396e  
    9292        else
    9393                fpu_disable();
    94 #else
     94#elif defined CONFIG_FPU
    9595        fpu_enable();
    9696        if (THREAD->fpu_context_exists)
     
    327327                THREAD->kcycles += get_cycle() - THREAD->last_cycle;
    328328               
    329 #ifndef CONFIG_FPU_LAZY
     329#if (defined CONFIG_FPU) && (!defined CONFIG_FPU_LAZY)
    330330                fpu_context_save(THREAD->saved_fpu_context);
    331331#endif
Note: See TracChangeset for help on using the changeset viewer.