Changeset 3451129 in mainline


Ignore:
Timestamp:
2012-09-07T15:05:43Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8776c46
Parents:
c6b601b (diff), 60d931d (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.

Files:
4 added
12 edited
21 moved

Legend:

Unmodified
Added
Removed
  • defaults/amd64/Makefile.config

    rc6b601b r3451129  
    5454
    5555# Default framebuffer mode
    56 CONFIG_BFB_MODE = 800x600
     56CONFIG_BFB_MODE = 1024x768
    5757
    5858# Default framebuffer depth
  • defaults/ia32/Makefile.config

    rc6b601b r3451129  
    6060
    6161# Default framebuffer mode
    62 CONFIG_BFB_MODE = 800x600
     62CONFIG_BFB_MODE = 1024x768
    6363
    6464# Default framebuffer depth
  • kernel/arch/arm32/Makefile.inc

    rc6b601b r3451129  
    3333ATSIGN = %
    3434
    35 GCC_CFLAGS += -march=$(subst _,-,$(PROCESSOR))
     35GCC_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR))
    3636
    3737BITS = 32
  • kernel/arch/arm32/include/istate.h

    rc6b601b r3451129  
    4949/** Struct representing CPU state saved when an exception occurs. */
    5050typedef struct istate {
     51        uint32_t dummy;
    5152        uint32_t spsr;
    5253        uint32_t sp;
  • kernel/arch/arm32/src/exc_handler.S

    rc6b601b r3451129  
    130130        stmfd r13!, {r2}
    1311312:
     132        sub sp, sp, #4
    132133.endm
    133134
    134135.macro LOAD_REGS_FROM_STACK
     136        add sp, sp, #4
    135137        ldmfd r13!, {r0}
    136138        msr spsr, r0
  • kernel/arch/arm32/src/mm/page_fault.c

    rc6b601b r3451129  
    8888}
    8989
    90 /** Decides whether the instruction is load/store or not.
    91  *
    92  * @param instr Instruction
    93  *
    94  * @return true when instruction is load/store, false otherwise
    95  *
    96  */
    97 static inline bool is_load_store_instruction(instruction_t instr)
    98 {
    99         /* load store immediate offset */
    100         if (instr.type == 0x2)
    101                 return true;
    102        
    103         /* load store register offset */
    104         if ((instr.type == 0x3) && (instr.bit4 == 0))
    105                 return true;
    106        
    107         /* load store multiple */
    108         if (instr.type == 0x4)
    109                 return true;
    110        
    111         /* oprocessor load/store */
    112         if (instr.type == 0x6)
    113                 return true;
    114        
    115         return false;
    116 }
    117 
    118 /** Decides whether the instruction is swap or not.
    119  *
    120  * @param instr Instruction
    121  *
    122  * @return true when instruction is swap, false otherwise
    123  */
    124 static inline bool is_swap_instruction(instruction_t instr)
    125 {
    126         /* swap, swapb instruction */
    127         if ((instr.type == 0x0) &&
    128             ((instr.opcode == 0x8) || (instr.opcode == 0xa)) &&
    129             (instr.access == 0x0) && (instr.bits567 == 0x4) && (instr.bit4 == 1))
    130                 return true;
    131        
    132         return false;
    133 }
    134 
    13590#if defined(PROCESSOR_armv4) | defined(PROCESSOR_armv5)
    13691/** Decides whether read or write into memory is requested.
     
    14095 *
    14196 * @return Type of access into memory, PF_ACCESS_EXEC if no memory access is
    142  *         requested.
     97 *         requested.
    14398 */
    14499static pf_access_t get_memory_access_type(uint32_t instr_addr,
     
    158113        }
    159114
    160         /* load store instructions */
    161         if (is_load_store_instruction(instr)) {
    162                 if (instr.access == 1) {
    163                         return PF_ACCESS_READ;
    164                 } else {
    165                         return PF_ACCESS_WRITE;
     115        /* See ARM Architecture reference manual ARMv7-A and ARMV7-R edition
     116         * A5.3 (PDF p. 206) */
     117        static const struct {
     118                uint32_t mask;
     119                uint32_t value;
     120                pf_access_t access;
     121        } ls_inst[] = {
     122                /* Store word/byte */
     123                { 0x0e100000, 0x04000000, PF_ACCESS_WRITE }, /*STR(B) imm*/
     124                { 0x0e100010, 0x06000000, PF_ACCESS_WRITE }, /*STR(B) reg*/
     125                /* Load word/byte */
     126                { 0x0e100000, 0x04100000, PF_ACCESS_READ }, /*LDR(B) imm*/
     127                { 0x0e100010, 0x06100000, PF_ACCESS_READ }, /*LDR(B) reg*/
     128                /* Store half-word/dual  A5.2.8 */
     129                { 0x0e1000b0, 0x000000b0, PF_ACCESS_WRITE }, /*STRH imm reg*/
     130                /* Load half-word/dual A5.2.8 */
     131                { 0x0e0000f0, 0x000000d0, PF_ACCESS_READ }, /*LDRH imm reg*/
     132                { 0x0e1000b0, 0x001000b0, PF_ACCESS_READ }, /*LDRH imm reg*/
     133                /* Block data transfer, Store */
     134                { 0x0e100000, 0x08000000, PF_ACCESS_WRITE }, /* STM variants */
     135                { 0x0e100000, 0x08100000, PF_ACCESS_READ },  /* LDM variants */
     136                /* Swap */
     137                { 0x0fb00000, 0x01000000, PF_ACCESS_WRITE },
     138        };
     139        const uint32_t inst = *(uint32_t*)instr_addr;
     140        for (unsigned i = 0; i < sizeof(ls_inst) / sizeof(ls_inst[0]); ++i) {
     141                if ((inst & ls_inst[i].mask) == ls_inst[i].value) {
     142                        return ls_inst[i].access;
    166143                }
    167         }
    168 
    169         /* swap, swpb instruction */
    170         if (is_swap_instruction(instr)) {
    171                 return PF_ACCESS_WRITE;
    172144        }
    173145
    174146        panic("page_fault - instruction doesn't access memory "
    175147            "(instr_code: %#0" PRIx32 ", badvaddr:%p).",
    176             *(uint32_t*)instr_union.instr, (void *) badvaddr);
    177 
    178         return PF_ACCESS_EXEC;
     148            inst, (void *) badvaddr);
    179149}
    180150#endif
  • uspace/app/tester/Makefile

    rc6b601b r3451129  
    2929
    3030USPACE_PREFIX = ../..
    31 LIBS = $(LIBEXT2_PREFIX)/libext2.a $(LIBBLOCK_PREFIX)/libblock.a
    32 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I$(LIBEXT2_PREFIX)
     31LIBS = $(LIBEXT2_PREFIX)/libext2.a $(LIBBLOCK_PREFIX)/libblock.a $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a
     32EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I$(LIBEXT2_PREFIX) -I$(LIBSOFTFLOAT_PREFIX)
    3333BINARY = tester
    3434
     
    4848        fault/fault2.c \
    4949        fault/fault3.c \
     50        float/float1.c \
     51        float/softfloat1.c \
    5052        vfs/vfs1.c \
    5153        ipc/ping_pong.c \
     
    5961        hw/misc/virtchar1.c \
    6062        hw/serial/serial1.c \
    61         libext2/libext2_1.c
     63        ext2/ext2_1.c
    6264
    6365include $(USPACE_PREFIX)/Makefile.common
  • uspace/app/tester/ext2/ext2_1.c

    rc6b601b r3451129  
    5151}
    5252
    53 const char *test_libext2_1(void)
     53const char *test_ext2_1(void)
    5454{
    5555        ext2_superblock_t *fake1;
    5656       
    57         TPRINTF("Testing libext2 superblock getters...\n");
     57        TPRINTF("Testing ext2 superblock getters...\n");
    5858        TPRINTF("Simple test for correct position and byte order\n");
    5959       
  • uspace/app/tester/ext2/ext2_1.def

    rc6b601b r3451129  
    11{
    2         "libext2_1",
     2        "ext2_1",
    33        "Superblock getters test",
    4         &test_libext2_1,
     4        &test_ext2_1,
    55        true
    66},
  • uspace/app/tester/tester.c

    rc6b601b r3451129  
    5858#include "fault/fault2.def"
    5959#include "fault/fault3.def"
     60#include "float/float1.def"
     61#include "float/softfloat1.def"
    6062#include "vfs/vfs1.def"
    6163#include "ipc/ping_pong.def"
     
    6870#include "hw/serial/serial1.def"
    6971#include "hw/misc/virtchar1.def"
    70 #include "libext2/libext2_1.def"
     72#include "ext2/ext2_1.def"
    7173        {NULL, NULL, NULL, false}
    7274};
  • uspace/app/tester/tester.h

    rc6b601b r3451129  
    9191extern const char *test_fault2(void);
    9292extern const char *test_fault3(void);
     93extern const char *test_float1(void);
     94extern const char *test_softfloat1(void);
    9395extern const char *test_vfs1(void);
    9496extern const char *test_ping_pong(void);
     
    101103extern const char *test_serial1(void);
    102104extern const char *test_virtchar1(void);
    103 extern const char *test_libext2_1(void);
     105extern const char *test_ext2_1(void);
    104106extern const char *test_devman1(void);
    105107extern const char *test_devman2(void);
  • uspace/lib/c/arch/arm32/Makefile.common

    rc6b601b r3451129  
    2828#
    2929
    30 GCC_CFLAGS += -ffixed-r9 -mtp=soft -fno-omit-frame-pointer -march=$(subst _,-,$(PROCESSOR))
     30GCC_CFLAGS += -ffixed-r9 -mtp=soft -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR))
    3131
    3232ENDIANESS = LE
  • uspace/lib/fs/libfs.c

    rc6b601b r3451129  
    631631                                                async_answer_0(rid, rc);
    632632                                        } else {
    633                                                 aoff64_t size = ops->size_get(fn);
    634                                                 async_answer_5(rid, fs_handle,
    635                                                     service_id,
    636                                                     ops->index_get(fn),
    637                                                     LOWER32(size),
    638                                                     UPPER32(size),
    639                                                     ops->lnkcnt_get(fn));
    640                                                 (void) ops->node_put(fn);
     633                                                (void) ops->node_put(cur);
     634                                                cur = fn;
     635                                                goto out_with_answer;
    641636                                        }
    642637                                } else
     
    715710                                        async_answer_0(rid, rc);
    716711                                } else {
    717                                         aoff64_t size = ops->size_get(fn);
    718                                         async_answer_5(rid, fs_handle,
    719                                             service_id,
    720                                             ops->index_get(fn),
    721                                             LOWER32(size),
    722                                             UPPER32(size),
    723                                             ops->lnkcnt_get(fn));
    724                                         (void) ops->node_put(fn);
     712                                        (void) ops->node_put(cur);
     713                                        cur = fn;
     714                                        goto out_with_answer;
    725715                                }
    726716                        } else
  • uspace/lib/softfloat/Makefile

    rc6b601b r3451129  
    2929
    3030USPACE_PREFIX = ../..
    31 EXTRA_CFLAGS = -Iinclude
    3231LIBRARY = libsoftfloat
    3332
    3433SOURCES = \
    35         generic/add.c \
    36         generic/common.c \
    37         generic/comparison.c \
    38         generic/conversion.c \
    39         generic/div.c \
    40         generic/mul.c \
    41         generic/other.c \
    42         generic/softfloat.c \
    43         generic/sub.c
     34        softfloat.c \
     35        common.c \
     36        add.c \
     37        sub.c \
     38        div.c \
     39        mul.c \
     40        comparison.c \
     41        conversion.c \
     42        other.c
    4443
    4544include $(USPACE_PREFIX)/Makefile.common
  • uspace/lib/softfloat/add.c

    rc6b601b r3451129  
    3434 */
    3535
    36 #include <sftypes.h>
    37 #include <add.h>
    38 #include <comparison.h>
    39 #include <common.h>
     36#include "sftypes.h"
     37#include "add.h"
     38#include "comparison.h"
     39#include "common.h"
    4040
    4141/** Add two single-precision floats with the same sign.
  • uspace/lib/softfloat/common.c

    rc6b601b r3451129  
    3434 */
    3535
    36 #include <sftypes.h>
    37 #include <common.h>
     36#include "sftypes.h"
     37#include "common.h"
    3838
    3939/* Table for fast leading zeroes counting. */
     
    5757};
    5858
    59 /** 
     59/**
    6060 * Take fraction shifted by 10 bits to the left, round it, normalize it
    6161 * and detect exceptions
     
    7575        while ((cexp > 0) && (cfrac) &&
    7676            (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1))))) {
    77                 cexp--; 
     77                cexp--;
    7878                cfrac <<= 1;
    7979                /* TODO: fix underflow */
     
    110110                ++cexp;
    111111                cfrac >>= 1;
    112         }       
     112        }
    113113
    114114        /* check overflow */
  • uspace/lib/softfloat/common.h

    rc6b601b r3451129  
    3737#define __COMMON_H__
    3838
    39 #include <sftypes.h>
     39#include "sftypes.h"
    4040
    4141extern float64 finish_float64(int32_t, uint64_t, char);
  • uspace/lib/softfloat/comparison.c

    rc6b601b r3451129  
    3434 */
    3535
    36 #include <sftypes.h>
    37 #include <comparison.h>
    38 #include <common.h>
     36#include "sftypes.h"
     37#include "comparison.h"
     38#include "common.h"
    3939
    4040/**
  • uspace/lib/softfloat/conversion.c

    rc6b601b r3451129  
    3434 */
    3535
    36 #include <sftypes.h>
    37 #include <conversion.h>
    38 #include <comparison.h>
    39 #include <common.h>
     36#include "sftypes.h"
     37#include "conversion.h"
     38#include "comparison.h"
     39#include "common.h"
    4040
    4141float64 float32_to_float64(float32 a)
  • uspace/lib/softfloat/div.c

    rc6b601b r3451129  
    3434 */
    3535
    36 #include <sftypes.h>
    37 #include <add.h>
    38 #include <div.h>
    39 #include <comparison.h>
    40 #include <mul.h>
    41 #include <common.h>
     36#include "sftypes.h"
     37#include "add.h"
     38#include "div.h"
     39#include "comparison.h"
     40#include "mul.h"
     41#include "common.h"
    4242
    4343/** Divide two single-precision floats.
  • uspace/lib/softfloat/mul.c

    rc6b601b r3451129  
    3434 */
    3535
    36 #include <sftypes.h>
    37 #include <mul.h>
    38 #include <comparison.h>
    39 #include <common.h>
     36#include "sftypes.h"
     37#include "mul.h"
     38#include "comparison.h"
     39#include "common.h"
    4040
    4141/** Multiply two single-precision floats.
  • uspace/lib/softfloat/softfloat.c

    rc6b601b r3451129  
    3636 */
    3737
    38 #include <softfloat.h>
    39 #include <sftypes.h>
    40 
    41 #include <add.h>
    42 #include <sub.h>
    43 #include <mul.h>
    44 #include <div.h>
    45 
    46 #include <conversion.h>
    47 #include <comparison.h>
    48 #include <other.h>
     38#include "softfloat.h"
     39#include "sftypes.h"
     40#include "add.h"
     41#include "sub.h"
     42#include "mul.h"
     43#include "div.h"
     44#include "conversion.h"
     45#include "comparison.h"
     46#include "other.h"
    4947
    5048/* Arithmetic functions */
     
    12771275}
    12781276
     1277int __aeabi_f2iz(float a)
     1278{
     1279        return __fixsfsi(a);
     1280}
     1281
    12791282int __aeabi_d2iz(double a)
    12801283{
     
    13001303{
    13011304        return __ltdf2(a, b);
     1305}
     1306
     1307int __aeabi_dcmpeq(double a, double b)
     1308{
     1309        return __eqdf2(a, b);
     1310}
     1311
     1312float __aeabi_fadd(float a, float b)
     1313{
     1314        return __addsf3(a, b);
     1315}
     1316
     1317float __aeabi_fsub(float a, float b)
     1318{
     1319        return __subsf3(a, b);
     1320}
     1321
     1322float __aeabi_fmul(float a, float b)
     1323{
     1324        return __mulsf3(a, b);
     1325}
     1326
     1327float __aeabi_fdiv(float a, float b)
     1328{
     1329        return __divsf3(a, b);
    13021330}
    13031331
  • uspace/lib/softfloat/softfloat.h

    rc6b601b r3451129  
    207207extern double __aeabi_ui2d(unsigned int);
    208208extern unsigned int __aeabi_d2uiz(double);
     209
     210extern int __aeabi_f2iz(float);
    209211extern int __aeabi_d2iz(double);
    210212
     
    212214extern int __aeabi_dcmpgt(double, double);
    213215extern int __aeabi_dcmplt(double, double);
     216extern int __aeabi_dcmpeq(double, double);
     217
     218extern float __aeabi_fadd(float, float);
     219extern float __aeabi_fsub(float, float);
     220extern float __aeabi_fmul(float, float);
     221extern float __aeabi_fdiv(float, float);
    214222
    215223extern double __aeabi_dadd(double, double);
  • uspace/lib/softfloat/sub.c

    rc6b601b r3451129  
    3434 */
    3535
    36 #include <sftypes.h>
    37 #include <sub.h>
    38 #include <comparison.h>
    39 #include <common.h>
     36#include "sftypes.h"
     37#include "sub.h"
     38#include "comparison.h"
     39#include "common.h"
    4040
    4141/** Subtract two single-precision floats with the same sign.
Note: See TracChangeset for help on using the changeset viewer.