Changeset f56e897f in mainline for kernel/generic


Ignore:
Timestamp:
2010-06-29T17:43:38Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6473d41
Parents:
e4a4b44 (diff), 793cf029 (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 mainlnie changes.

Location:
kernel/generic
Files:
12 edited

Legend:

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

    re4a4b44 rf56e897f  
    4141
    4242ATOMIC static inline void atomic_set(atomic_t *val, atomic_count_t i)
     43    WRITES(&val->count)
     44    REQUIRES_EXTENT_MUTABLE(val)
    4345{
    4446        val->count = i;
     
    4648
    4749ATOMIC static inline atomic_count_t atomic_get(atomic_t *val)
     50    REQUIRES_EXTENT_MUTABLE(val)
    4851{
    4952        return val->count;
  • kernel/generic/include/config.h

    re4a4b44 rf56e897f  
    7070       
    7171        uintptr_t base;
    72         size_t kernel_size;           /**< Size of memory in bytes taken by kernel and stack */
     72        size_t kernel_size;          /**< Size of memory in bytes taken by kernel and stack */
    7373       
    74         uintptr_t stack_base;         /**< Base adddress of initial stack */
    75         size_t stack_size;            /**< Size of initial stack */
     74        uintptr_t stack_base;        /**< Base adddress of initial stack */
     75        size_t stack_size;           /**< Size of initial stack */
    7676} config_t;
    7777
  • kernel/generic/include/smp/ipi.h

    re4a4b44 rf56e897f  
    4343#else
    4444
    45         #define ipi_broadcast(ipi)
     45#define ipi_broadcast(ipi)
    4646
    4747#endif /* CONFIG_SMP */
  • kernel/generic/include/verify.h

    re4a4b44 rf56e897f  
    3939#ifdef CONFIG_VERIFY_VCC
    4040
    41 #define ATOMIC         __spec_attr("atomic_inline", "")
    42 #define REQUIRES(...)  __requires(__VA_ARGS__)
     41#define ATOMIC         __specification_attr("atomic_inline", "")
     42
     43#define READS(ptr)     __specification(reads(ptr))
     44#define WRITES(ptr)    __specification(writes(ptr))
     45#define REQUIRES(...)  __specification(requires __VA_ARGS__)
     46
     47#define EXTENT(ptr)              \extent(ptr)
     48#define ARRAY_RANGE(ptr, nmemb)  \array_range(ptr, nmemb)
     49
     50#define REQUIRES_EXTENT_MUTABLE(ptr) \
     51        REQUIRES(\extent_mutable(ptr))
     52
     53#define REQUIRES_ARRAY_MUTABLE(ptr, nmemb) \
     54        REQUIRES(\mutable_array(ptr, nmemb))
    4355
    4456#else /* CONFIG_VERIFY_VCC */
    4557
    4658#define ATOMIC
     59
     60#define READS(ptr)
     61#define WRITES(ptr)
    4762#define REQUIRES(...)
     63
     64#define EXTENT(ptr)
     65#define ARRAY_RANGE(ptr, nmemb)
     66
     67#define REQUIRES_EXTENT_MUTABLE(ptr)
     68#define REQUIRES_ARRAY_MUTABLE(ptr, nmemb)
    4869
    4970#endif /* CONFIG_VERIFY_VCC */
  • kernel/generic/src/debug/symtab.c

    re4a4b44 rf56e897f  
    4646/** Get name of a symbol that seems most likely to correspond to address.
    4747 *
    48  * @param addr          Address.
    49  * @param name          Place to store pointer to the symbol name.
    50  * @param offset        Place to store offset from the symbol address.
     48 * @param addr   Address.
     49 * @param name   Place to store pointer to the symbol name.
     50 * @param offset Place to store offset from the symbol address.
    5151 *
    5252 * @return Zero on success or negative error code, ENOENT if not found,
     
    8383/** Lookup symbol by address and format for display.
    8484 *
    85  * Returns name of closest corresponding symbol, "Not found" if none exists
    86  * or "N/A" if no symbol information is available.
     85 * Returns name of closest corresponding symbol,
     86 * "unknown" if none exists and "N/A" if no symbol
     87 * information is available.
    8788 *
    8889 * @param addr Address.
     
    101102                return name;
    102103        case ENOENT:
    103                 return "Not found";
     104                return "unknown";
    104105        default:
    105106                return "N/A";
  • kernel/generic/src/interrupt/interrupt.c

    re4a4b44 rf56e897f  
    143143        uint64_t end_cycle = get_cycle();
    144144       
     145        irq_spinlock_lock(&exctbl_lock, false);
    145146        exc_table[n].cycles += end_cycle - begin_cycle;
    146147        exc_table[n].count++;
     148        irq_spinlock_unlock(&exctbl_lock, false);
    147149       
    148150        /* Do not charge THREAD for exception cycles */
  • kernel/generic/src/ipc/sysipc.c

    re4a4b44 rf56e897f  
    11501150                return (unative_t) rc;
    11511151       
    1152         LOG("sys_ipc_connect_kbox(%" PRIu64 ")\n", taskid_arg.value);
     1152        LOG("sys_ipc_connect_kbox(%" PRIu64 ")", taskid_arg.value);
    11531153       
    11541154        return ipc_connect_kbox(taskid_arg.value);
  • kernel/generic/src/main/kinit.c

    re4a4b44 rf56e897f  
    107107        if (config.cpu_count > 1) {
    108108                waitq_initialize(&ap_completion_wq);
     109               
    109110                /*
    110111                 * Create the kmp thread and wait for its completion.
     
    124125                thread_join(thread);
    125126                thread_detach(thread);
    126         }
    127        
    128         if (config.cpu_count > 1) {
     127               
     128                /*
     129                 * For each CPU, create its load balancing thread.
     130                 */
    129131                size_t i;
    130132               
    131                 /*
    132                  * For each CPU, create its load balancing thread.
    133                  */
    134133                for (i = 0; i < config.cpu_count; i++) {
    135134                        thread = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb", true);
  • kernel/generic/src/mm/frame.c

    re4a4b44 rf56e897f  
    12341234{
    12351235#ifdef __32_BITS__
    1236         printf("[nr] [base addr ] [frames    ] [flags ] [free frames ] [busy frames ]\n");
     1236        printf("[nr] [base addr] [frames    ] [flags ] [free frames ] [busy frames ]\n");
    12371237#endif
    12381238
    12391239#ifdef __64_BITS__
    1240         printf("[nr] [base address      ] [frames    ] [flags ] [free frames ] [busy frames ]\n");
     1240        printf("[nr] [base address    ] [frames    ] [flags ] [free frames ] [busy frames ]\n");
    12411241#endif
    12421242       
     
    12741274               
    12751275#ifdef __32_BITS__
    1276                 printf("   %10p", base);
     1276                printf("  %10p", base);
    12771277#endif
    12781278               
    12791279#ifdef __64_BITS__
    1280                 printf("   %18p", base);
     1280                printf(" %18p", base);
    12811281#endif
    12821282               
  • kernel/generic/src/mm/tlb.c

    re4a4b44 rf56e897f  
    7373 * to all other processors.
    7474 *
    75  * @param type          Type describing scope of shootdown.
    76  * @param asid          Address space, if required by type.
    77  * @param page          Virtual page address, if required by type.
    78  * @param count         Number of pages, if required by type.
     75 * @param type  Type describing scope of shootdown.
     76 * @param asid  Address space, if required by type.
     77 * @param page  Virtual page address, if required by type.
     78 * @param count Number of pages, if required by type.
    7979 *
    8080 * @return The interrupt priority level as it existed prior to this call.
     81 *
    8182 */
    8283ipl_t tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid,
    8384    uintptr_t page, size_t count)
    8485{
    85         ipl_t ipl;
    86 
    87         ipl = interrupts_disable();
     86        ipl_t ipl = interrupts_disable();
    8887        CPU->tlb_active = false;
    8988        irq_spinlock_lock(&tlblock, false);
     
    9190        size_t i;
    9291        for (i = 0; i < config.cpu_count; i++) {
    93                 cpu_t *cpu;
    94                
    9592                if (i == CPU->id)
    9693                        continue;
    9794               
    98                 cpu = &cpus[i];
     95                cpu_t *cpu = &cpus[i];
     96               
    9997                irq_spinlock_lock(&cpu->lock, false);
    10098                if (cpu->tlb_messages_count == TLB_MESSAGE_QUEUE_LEN) {
     
    124122       
    125123busy_wait:
    126         for (i = 0; i < config.cpu_count; i++)
     124        for (i = 0; i < config.cpu_count; i++) {
    127125                if (cpus[i].tlb_active)
    128126                        goto busy_wait;
    129 
     127        }
     128       
    130129        return ipl;
    131130}
     
    133132/** Finish TLB shootdown sequence.
    134133 *
    135  * @param ipl           Previous interrupt priority level.
     134 * @param ipl Previous interrupt priority level.
     135 *
    136136 */
    137137void tlb_shootdown_finalize(ipl_t ipl)
  • kernel/generic/src/proc/program.c

    re4a4b44 rf56e897f  
    145145               
    146146                program_loader = image_addr;
    147                 LOG("Registered program loader at 0x%" PRIp "\n",
     147                LOG("Registered program loader at 0x%" PRIp,
    148148                    image_addr);
    149149               
  • kernel/generic/src/smp/ipi.c

    re4a4b44 rf56e897f  
    4747 * @param ipi Message to broadcast.
    4848 *
    49  * @bug The decision whether to actually send the IPI must be based
    50  *      on a different criterion. The current version has
    51  *      problems when some of the detected CPUs are marked
    52  *      disabled in machine configuration.
    5349 */
    5450void ipi_broadcast(int ipi)
     
    6056         */
    6157       
    62         if ((config.cpu_active > 1) && (config.cpu_active == config.cpu_count))
     58        if (config.cpu_count > 1)
    6359                ipi_broadcast_arch(ipi);
    6460}
Note: See TracChangeset for help on using the changeset viewer.