Changeset 696979ce in mainline for kernel/arch


Ignore:
Timestamp:
2010-02-06T10:54:21Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5bda2f96
Parents:
3f93cdbe (diff), 25e963a (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 from mainline.

Location:
kernel/arch
Files:
2 added
18 edited

Legend:

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

    r3f93cdbe r696979ce  
    4141        arch/$(KARCH)/src/userspace.c \
    4242        arch/$(KARCH)/src/cpu/cpu.c \
     43        arch/$(KARCH)/src/ddi/ddi.c \
     44        arch/$(KARCH)/src/smp/smp.c \
    4345        arch/$(KARCH)/src/mm/as.c \
    4446        arch/$(KARCH)/src/mm/frame.c \
  • kernel/arch/abs32le/include/asm.h

    r3f93cdbe r696979ce  
    4949
    5050
    51 static inline void cpu_halt(void)
     51static inline __attribute__((noreturn)) void cpu_halt(void)
    5252{
    5353        /* On real hardware this should stop processing further
  • kernel/arch/abs32le/include/context.h

    r3f93cdbe r696979ce  
    3636#define KERN_abs32le_CONTEXT_H_
    3737
    38 #ifdef KERNEL
    39 #include <arch/types.h>
    40 
    4138#define STACK_ITEM_SIZE  4
    4239#define SP_DELTA         0
    4340
    44 #define context_set(c, _pc, stack, size) \
    45         do { \
    46                 (c)->pc = (uintptr_t) (_pc); \
    47         } while (0)
    48 
    49 #endif /* KERNEL */
     41#define context_set(ctx, pc, stack, size) \
     42    context_set_generic(ctx, pc, stack, size)
    5043
    5144/*
  • kernel/arch/abs32le/include/interrupt.h

    r3f93cdbe r696979ce  
    4040#define IVT_ITEMS  0
    4141#define IVT_FIRST  0
     42
     43#define VECTOR_TLB_SHOOTDOWN_IPI  0
    4244
    4345/*
  • kernel/arch/abs32le/src/abs32le.c

    r3f93cdbe r696979ce  
    3939#include <arch/asm.h>
    4040
     41#include <func.h>
    4142#include <config.h>
     43#include <context.h>
    4244#include <interrupt.h>
    4345#include <ddi/irq.h>
     
    107109}
    108110
     111void memsetb(void *dst, size_t cnt, uint8_t val)
     112{
     113        _memsetb(dst, cnt, val);
     114}
     115
     116void memsetw(void *dst, size_t cnt, uint16_t val)
     117{
     118        _memsetw(dst, cnt, val);
     119}
     120
     121void panic_printf(char *fmt, ...)
     122{
     123        va_list args;
     124       
     125        va_start(args, fmt);
     126        vprintf(fmt, args);
     127        va_end(args);
     128       
     129        halt();
     130}
     131
     132int context_save_arch(context_t *ctx)
     133{
     134        return 1;
     135}
     136
     137void context_restore_arch(context_t *ctx)
     138{
     139        while (true);
     140}
     141
    109142/** @}
    110143 */
  • kernel/arch/abs32le/src/debug/stacktrace.c

    r3f93cdbe r696979ce  
    2727 */
    2828
    29 /** @addtogroup ia32
     29/** @addtogroup abs32le
    3030 * @{
    3131 */
     
    3838#include <typedefs.h>
    3939
    40 #define FRAME_OFFSET_FP_PREV    0
    41 #define FRAME_OFFSET_RA         1
    42 
    4340bool kernel_frame_pointer_validate(uintptr_t fp)
    4441{
    45         return fp != 0;
     42        return true;;
    4643}
    4744
    4845bool kernel_frame_pointer_prev(uintptr_t fp, uintptr_t *prev)
    4946{
    50         uint32_t *stack = (void *) fp;
    51         *prev = stack[FRAME_OFFSET_FP_PREV];
    5247        return true;
    5348}
     
    5550bool kernel_return_address_get(uintptr_t fp, uintptr_t *ra)
    5651{
    57         uint32_t *stack = (void *) fp;
    58         *ra = stack[FRAME_OFFSET_RA];
    5952        return true;
    6053}
     
    6255bool uspace_frame_pointer_validate(uintptr_t fp)
    6356{
    64         return fp != 0;
     57        return true;
    6558}
    6659
    6760bool uspace_frame_pointer_prev(uintptr_t fp, uintptr_t *prev)
    6861{
    69         return !copy_from_uspace((void *) prev,
    70             (uint32_t *) fp + FRAME_OFFSET_FP_PREV, sizeof(*prev));
     62        return true;
    7163}
    7264
    7365bool uspace_return_address_get(uintptr_t fp, uintptr_t *ra)
    7466{
    75         return !copy_from_uspace((void *) ra, (uint32_t *) fp + FRAME_OFFSET_RA,
    76             sizeof(*ra));
     67        return true;
     68}
     69
     70uintptr_t frame_pointer_get(void)
     71{
     72        return 0;
     73}
     74
     75uintptr_t program_counter_get(void)
     76{
     77        return 0;
    7778}
    7879
  • kernel/arch/amd64/include/asm.h

    r3f93cdbe r696979ce  
    6868}
    6969
    70 static inline void cpu_halt(void)
    71 {
    72         asm volatile (
    73                 "0:\n"
    74                 "       hlt\n"
    75                 "       jmp 0b\n"
    76         );
     70static inline void __attribute__((noreturn)) cpu_halt(void)
     71{
     72        while (true) {
     73                asm volatile (
     74                        "hlt\n"
     75                );
     76        }
    7777}
    7878
  • kernel/arch/arm32/include/asm.h

    r3f93cdbe r696979ce  
    9696}
    9797
    98 extern void cpu_halt(void);
     98extern void cpu_halt(void) __attribute__((noreturn));
    9999extern void asm_delay_loop(uint32_t t);
    100100extern void userspace_asm(uintptr_t ustack, uintptr_t uspace_uarg,
  • kernel/arch/arm32/src/arm32.c

    r3f93cdbe r696979ce  
    155155void cpu_halt(void)
    156156{
    157         machine_cpu_halt();
     157        while (true)
     158                machine_cpu_halt();
    158159}
    159160
     
    162163{
    163164        /* not implemented */
    164         while (1);
     165        while (true);
    165166}
    166167
  • kernel/arch/ia32/include/asm.h

    r3f93cdbe r696979ce  
    6060 *
    6161 */
    62 static inline void cpu_halt(void)
    63 {
    64         asm volatile (
    65                 "0:\n"
    66                 "       hlt\n"
    67                 "       jmp 0b\n"
    68         );
     62static inline __attribute__((noreturn)) void cpu_halt(void)
     63{
     64        while (true) {
     65                asm volatile (
     66                        "hlt\n"
     67                );
     68        }
    6969}
    7070
  • kernel/arch/ia64/include/asm.h

    r3f93cdbe r696979ce  
    428428}
    429429
    430 extern void cpu_halt(void);
     430extern void cpu_halt(void) __attribute__((noreturn));
    431431extern void cpu_sleep(void);
    432432extern void asm_delay_loop(uint32_t t);
  • kernel/arch/ia64/include/context.h

    r3f93cdbe r696979ce  
    4848 */
    4949#define SP_DELTA        (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
    50 
    51 #ifdef context_set
    52 #undef context_set
    53 #endif
    5450
    5551/* RSE stack starts at the bottom of memory stack. */
  • kernel/arch/mips32/include/asm.h

    r3f93cdbe r696979ce  
    6666}
    6767
    68 extern void cpu_halt(void);
     68extern void cpu_halt(void) __attribute__((noreturn));
    6969extern void asm_delay_loop(uint32_t t);
    7070extern void userspace_asm(uintptr_t ustack, uintptr_t uspace_uarg,
  • kernel/arch/mips32/include/context.h

    r3f93cdbe r696979ce  
    2727 */
    2828
    29 /** @addtogroup mips32 
     29/** @addtogroup mips32
    3030 * @{
    3131 */
     
    4242 * Put one item onto the stack to support get_stack_base() and align it up.
    4343 */
    44 #define SP_DELTA        (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
    45 
     44#define SP_DELTA  (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
    4645
    4746#ifndef __ASM__
    4847
    4948#include <arch/types.h>
     49
     50#define context_set(ctx, pc, stack, size) \
     51    context_set_generic(ctx, pc, stack, size)
    5052
    5153/*
  • kernel/arch/ppc32/include/asm.h

    r3f93cdbe r696979ce  
    2727 */
    2828
    29 /** @addtogroup ppc32   
     29/** @addtogroup ppc32
    3030 * @{
    3131 */
     
    146146}
    147147
    148 void cpu_halt(void);
    149 void asm_delay_loop(uint32_t t);
    150 
     148extern void cpu_halt(void) __attribute__((noreturn));
     149extern void asm_delay_loop(uint32_t t);
    151150extern void userspace_asm(uintptr_t uspace_uarg, uintptr_t stack, uintptr_t entry);
    152151
    153152static inline void pio_write_8(ioport8_t *port, uint8_t v)
    154153{
    155         *port = v;     
     154        *port = v;
    156155}
    157156
    158157static inline void pio_write_16(ioport16_t *port, uint16_t v)
    159158{
    160         *port = v;     
     159        *port = v;
    161160}
    162161
    163162static inline void pio_write_32(ioport32_t *port, uint32_t v)
    164163{
    165         *port = v;     
     164        *port = v;
    166165}
    167166
    168167static inline uint8_t pio_read_8(ioport8_t *port)
    169168{
    170         return *port; 
     169        return *port;
    171170}
    172171
    173172static inline uint16_t pio_read_16(ioport16_t *port)
    174173{
    175         return *port; 
     174        return *port;
    176175}
    177176
    178177static inline uint32_t pio_read_32(ioport32_t *port)
    179178{
    180         return *port; 
     179        return *port;
    181180}
    182181
  • kernel/arch/ppc32/include/context.h

    r3f93cdbe r696979ce  
    2727 */
    2828
    29 /** @addtogroup ppc32   
     29/** @addtogroup ppc32
    3030 * @{
    3131 */
     
    3838#include <arch/types.h>
    3939
    40 #define SP_DELTA        16
     40#define SP_DELTA  16
     41
     42#define context_set(ctx, pc, stack, size) \
     43    context_set_generic(ctx, pc, stack, size)
    4144
    4245typedef struct {
     
    6871       
    6972        ipl_t ipl;
    70 } __attribute__ ((packed)) context_t;
     73} __attribute__((packed)) context_t;
    7174
    7275#endif
  • kernel/arch/sparc64/include/asm.h

    r3f93cdbe r696979ce  
    430430}
    431431
    432 extern void cpu_halt(void);
     432extern void cpu_halt(void) __attribute__((noreturn));
    433433extern void cpu_sleep(void);
    434434extern void asm_delay_loop(const uint32_t usec);
  • kernel/arch/sparc64/include/context.h

    r3f93cdbe r696979ce  
    4242#define SP_DELTA        (STACK_WINDOW_SAVE_AREA_SIZE + STACK_ARG_SAVE_AREA_SIZE)
    4343
    44 #ifdef context_set
    45 #undef context_set
    46 #endif
    47 
    4844#define context_set(c, _pc, stack, size)                        \
    4945        (c)->pc = ((uintptr_t) _pc) - 8;                        \
Note: See TracChangeset for help on using the changeset viewer.