Changeset da1bafb in mainline for kernel/arch/mips32/include


Ignore:
Timestamp:
2010-05-24T18:57:31Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0095368
Parents:
666f492
Message:

major code revision

  • replace spinlocks taken with interrupts disabled with irq_spinlocks
  • change spacing (not indendation) to be tab-size independent
  • use unsigned integer types where appropriate (especially bit flags)
  • visual separation
  • remove argument names in function prototypes
  • string changes
  • correct some formating directives
  • replace various cryptic single-character variables (t, a, m, c, b, etc.) with proper identifiers (thread, task, timeout, as, itm, itc, etc.)
  • unify some assembler constructs
  • unused page table levels are now optimized out in compile time
  • replace several ints (with boolean semantics) with bools
  • use specifically sized types instead of generic types where appropriate (size_t, uint32_t, btree_key_t)
  • improve comments
  • split asserts with conjuction into multiple independent asserts
Location:
kernel/arch/mips32/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/include/asm.h

    r666f492 rda1bafb  
    3939#include <config.h>
    4040
    41 
    4241static inline void cpu_sleep(void)
    4342{
     
    4746
    4847/** Return base address of current stack
    49  * 
     48 *
    5049 * Return the base address of the current stack.
    5150 * The stack is assumed to be STACK_SIZE bytes long.
    5251 * The stack must start on page boundary.
     52 *
    5353 */
    5454static inline uintptr_t get_stack_base(void)
    5555{
    56         uintptr_t v;
     56        uintptr_t base;
    5757       
    5858        asm volatile (
    59                 "and %0, $29, %1\n"
    60                 : "=r" (v)
    61                 : "r" (~(STACK_SIZE-1))
     59                "and %[base], $29, %[mask]\n"
     60                : [base] "=r" (base)
     61                : [mask] "r" (~(STACK_SIZE - 1))
    6262        );
    6363       
    64         return v;
     64        return base;
    6565}
    6666
     
    7878static inline void pio_write_8(ioport8_t *port, uint8_t v)
    7979{
    80         *port = v;     
     80        *port = v;
    8181}
    8282
    8383static inline void pio_write_16(ioport16_t *port, uint16_t v)
    8484{
    85         *port = v;     
     85        *port = v;
    8686}
    8787
    8888static inline void pio_write_32(ioport32_t *port, uint32_t v)
    8989{
    90         *port = v;     
     90        *port = v;
    9191}
    9292
  • kernel/arch/mips32/include/debugger.h

    r666f492 rda1bafb  
    4141#define BKPOINTS_MAX 10
    4242
    43 #define BKPOINT_INPROG   (1 << 0)   /**< Breakpoint was shot */
    44 #define BKPOINT_ONESHOT  (1 << 1)   /**< One-time breakpoint,mandatory for j/b
    45                                          instructions */
    46 #define BKPOINT_REINST   (1 << 2)   /**< Breakpoint is set on the next
    47                                          instruction, so that it could be
    48                                          reinstalled on the previous one */
    49 #define BKPOINT_FUNCCALL (1 << 3)   /**< Call a predefined function */
     43/** Breakpoint was shot */
     44#define BKPOINT_INPROG  (1 << 0)
     45
     46/** One-time breakpoint, mandatory for j/b instructions */
     47#define BKPOINT_ONESHOT  (1 << 1)
     48
     49/**
     50 * Breakpoint is set on the next instruction, so that it
     51 * could be reinstalled on the previous one
     52 */
     53#define BKPOINT_REINST  (1 << 2)
     54
     55/** Call a predefined function */
     56#define BKPOINT_FUNCCALL  (1 << 3)
     57
    5058
    5159typedef struct  {
    52         uintptr_t address;      /**< Breakpoint address */
    53         unative_t instruction; /**< Original instruction */
     60        uintptr_t address;          /**< Breakpoint address */
     61        unative_t instruction;      /**< Original instruction */
    5462        unative_t nextinstruction;  /**< Original instruction following break */
    55         int flags;        /**< Flags regarding breakpoint */
     63        unsigned int flags;         /**< Flags regarding breakpoint */
    5664        size_t counter;
    57         void (*bkfunc)(void *b, istate_t *istate);
     65        void (*bkfunc)(void *, istate_t *);
    5866} bpinfo_t;
    5967
     68extern bpinfo_t breakpoints[BKPOINTS_MAX];
     69
    6070extern void debugger_init(void);
    61 void debugger_bpoint(istate_t *istate);
    62 
    63 extern bpinfo_t breakpoints[BKPOINTS_MAX];
     71extern void debugger_bpoint(istate_t *);
    6472
    6573#endif
  • kernel/arch/mips32/include/mm/as.h

    r666f492 rda1bafb  
    2727 */
    2828
    29 /** @addtogroup mips32mm       
     29/** @addtogroup mips32mm
    3030 * @{
    3131 */
     
    3636#define KERN_mips32_AS_H_
    3737
    38 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH      0
     38#define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH  0
    3939
    4040#define KERNEL_ADDRESS_SPACE_START_ARCH         (unsigned long) 0x80000000
Note: See TracChangeset for help on using the changeset viewer.