Changeset 02a99d2 in mainline for src


Ignore:
Timestamp:
2005-05-11T19:51:55Z (20 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
69515260
Parents:
45671f48
Message:

NDEBUG debug symbol, ASSERT debug macro, fancier panic() in debug mode
indentation fixes, ASSERTs

Location:
src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • src/debug/print.c

    r45671f48 r02a99d2  
    4747void print_str(const char *str)
    4848{
    49         int i = 0;
     49        int i = 0;
    5050        char c;
    51    
     51       
    5252        while (c = str[i++])
    53             putchar(c);
     53                putchar(c);
    5454}
    5555
     
    8585 *
    8686 */
    87 void print_number(const __native num, const int base)
     87void print_number(const __native num, const unsigned int base)
    8888{
    8989        int val = num;
    9090        char d[sizeof(__native)*8+1];           /* this is good enough even for base == 2 */
    91         int i = sizeof(__native)*8-1;
    92    
     91        int i = sizeof(__native)*8-1;
     92       
    9393        do {
    9494                d[i--] = digits[val % base];
  • src/main/kinit.c

    r45671f48 r02a99d2  
    120120         */
    121121        m = vm_create();
    122         if (!m) panic(PANIC "vm_create");
     122        if (!m) panic("vm_create");
    123123        u = task_create(m);
    124         if (!u) panic(PANIC "task_create");
     124        if (!u) panic("task_create");
    125125        t = thread_create(uinit, NULL, u, THREAD_USER_STACK);
    126         if (!t) panic(PANIC "thread_create");
     126        if (!t) panic("thread_create");
    127127
    128128        /*
     
    130130         */     
    131131        a = vm_area_create(m, VMA_TEXT, 1, UTEXT_ADDRESS);
    132         if (!a) panic(PANIC "vm_area_create: vm_text");
     132        if (!a) panic("vm_area_create: vm_text");
    133133        memcopy((__address) utext, PA2KA(a->mapping[0]), utext_size < PAGE_SIZE ? utext_size : PAGE_SIZE);             
    134134
     
    137137         */
    138138        a = vm_area_create(m, VMA_STACK, 1, USTACK_ADDRESS);
    139         if (!a) panic(PANIC "vm_area_create: vm_stack");
     139        if (!a) panic("vm_area_create: vm_stack");
    140140       
    141141        thread_ready(t);
  • src/main/main.c

    r45671f48 r02a99d2  
    3030#include <arch/context.h>
    3131#include <print.h>
     32#include <panic.h>
    3233#include <config.h>
    3334#include <time/clock.h>
  • src/mm/frame.c

    r45671f48 r02a99d2  
    7272                frame_bitmap = (__u8 *) malloc(frame_bitmap_octets);
    7373                if (!frame_bitmap)
    74                         panic(PANIC "malloc/frame_bitmap\n");
     74                        panic("malloc/frame_bitmap\n");
    7575
    7676                /*
     
    145145                        }
    146146                }
    147                 panic(PANIC "frames_free inconsistent (%d)\n", frames_free);
     147                panic("frames_free inconsistent (%d)\n", frames_free);
    148148        }
    149149        spinlock_unlock(&framelock);
     
    151151
    152152        if (flags & FRAME_PANIC)
    153                 panic(PANIC "unable to allocate frame\n");
     153                panic("unable to allocate frame\n");
    154154               
    155155        /* TODO: implement sleeping logic here */
    156         panic(PANIC "sleep not supported\n");
     156        panic("sleep not supported\n");
    157157       
    158158        goto loop;
     
    196196                        }       
    197197                }
    198                 else panic(PANIC "frame_free: frame already free\n");
    199         }
    200         else panic(PANIC "frame_free: frame number too big\n");
     198                else panic("frame_free: frame already free\n");
     199        }
     200        else panic("frame_free: frame number too big\n");
    201201       
    202202        spinlock_unlock(&framelock);
  • src/mm/heap.c

    r45671f48 r02a99d2  
    3131#include <func.h>
    3232#include <memstr.h>
     33#include <panic.h>
    3334#include <arch/types.h>
    3435
  • src/mm/vm.c

    r45671f48 r02a99d2  
    6363       
    6464        if (addr % PAGE_SIZE)
    65                 panic(PANIC "addr not aligned to a page boundary");
     65                panic("addr not aligned to a page boundary");
    6666       
    6767        pri = cpu_priority_high();
     
    125125                        break;
    126126                default:
    127                         panic(PANIC "unexpected vm_type_t %d", a->type);
     127                        panic("unexpected vm_type_t %d", a->type);
    128128        }
    129129       
  • src/proc/scheduler.c

    r45671f48 r02a99d2  
    3838#include <arch/asm.h>
    3939#include <list.h>
     40#include <panic.h>
    4041#include <typedefs.h>
    4142#include <mm/page.h>
  • src/synch/rwlock.c

    r45671f48 r02a99d2  
    185185                                break;
    186186                        case ESYNCH_OK_ATOMIC:
    187                                 panic(PANIC "_mutex_lock_timeout()==ESYNCH_OK_ATOMIC");
     187                                panic("_mutex_lock_timeout()==ESYNCH_OK_ATOMIC");
    188188                                break;
    189189                        dafault:
    190                                 panic(PANIC "invalid ESYNCH");
     190                                panic("invalid ESYNCH");
    191191                                break;
    192192                }
  • src/time/timeout.c

    r45671f48 r02a99d2  
    3131#include <arch/types.h>
    3232#include <config.h>
     33#include <panic.h>
    3334#include <synch/spinlock.h>
    3435#include <func.h>
Note: See TracChangeset for help on using the changeset viewer.