Changeset da1bafb in mainline for kernel/generic/include/cpu.h


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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/cpu.h

    r666f492 rda1bafb  
    4242#include <arch/context.h>
    4343
    44 #define CPU_STACK_SIZE  STACK_SIZE
     44#define CPU_STACK_SIZE  STACK_SIZE
    4545
    4646/** CPU structure.
     
    4949 */
    5050typedef struct cpu {
    51         SPINLOCK_DECLARE(lock);
    52 
     51        IRQ_SPINLOCK_DECLARE(lock);
     52       
    5353        tlb_shootdown_msg_t tlb_messages[TLB_MESSAGE_QUEUE_LEN];
    5454        size_t tlb_messages_count;
    5555       
    5656        context_t saved_context;
    57 
     57       
    5858        atomic_t nrdy;
    5959        runq_t rq[RQ_COUNT];
    6060        volatile size_t needs_relink;
    61 
    62         SPINLOCK_DECLARE(timeoutlock);
     61       
     62        IRQ_SPINLOCK_DECLARE(timeoutlock);
    6363        link_t timeout_active_head;
    64 
    65         size_t missed_clock_ticks;      /**< When system clock loses a tick, it is recorded here
    66                                              so that clock() can react. This variable is
    67                                              CPU-local and can be only accessed when interrupts
    68                                              are disabled. */
    69 
     64       
     65        /**
     66         * When system clock loses a tick, it is
     67         * recorded here so that clock() can react.
     68         * This variable is CPU-local and can be
     69         * only accessed when interrupts are
     70         * disabled.
     71         */
     72        size_t missed_clock_ticks;
     73       
    7074        bool idle;
    7175        uint64_t idle_ticks;
    7276        uint64_t busy_ticks;
    73 
     77       
    7478        /**
    7579         * Processor ID assigned by kernel.
    7680         */
    77         unsigned int id;
     81        size_t id;
    7882       
    7983        bool active;
    80         int tlb_active;
    81 
     84        bool tlb_active;
     85       
    8286        uint16_t frequency_mhz;
    8387        uint32_t delay_loop_const;
    84 
     88       
    8589        cpu_arch_t arch;
    86 
     90       
    8791        struct thread *fpu_owner;
    8892       
     
    100104extern void cpu_arch_init(void);
    101105extern void cpu_identify(void);
    102 extern void cpu_print_report(cpu_t *m);
     106extern void cpu_print_report(cpu_t *);
    103107
    104108#endif
Note: See TracChangeset for help on using the changeset viewer.