Subversion Repositories HelenOS

Rev

Rev 4377 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4377 Rev 4692
Line 50... Line 50...
50
 
50
 
51
static void falloc(void *arg)
51
static void falloc(void *arg)
52
{
52
{
53
    int order, run, allocated, i;
53
    int order, run, allocated, i;
54
    uint8_t val = THREAD->tid % THREADS;
54
    uint8_t val = THREAD->tid % THREADS;
55
    index_t k;
55
    size_t k;
56
   
56
   
57
    void **frames =  (void **) malloc(MAX_FRAMES * sizeof(void *), FRAME_ATOMIC);
57
    void **frames =  (void **) malloc(MAX_FRAMES * sizeof(void *), FRAME_ATOMIC);
58
    if (frames == NULL) {
58
    if (frames == NULL) {
59
        TPRINTF("Thread #%" PRIu64 " (cpu%u): Unable to allocate frames\n", THREAD->tid, CPU->id);
59
        TPRINTF("Thread #%" PRIu64 " (cpu%u): Unable to allocate frames\n", THREAD->tid, CPU->id);
60
        atomic_inc(&thread_fail);
60
        atomic_inc(&thread_fail);
Line 80... Line 80...
80
           
80
           
81
            TPRINTF("Thread #%" PRIu64 " (cpu%u): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
81
            TPRINTF("Thread #%" PRIu64 " (cpu%u): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
82
            TPRINTF("Thread #%" PRIu64 " (cpu%u): Deallocating ... \n", THREAD->tid, CPU->id);
82
            TPRINTF("Thread #%" PRIu64 " (cpu%u): Deallocating ... \n", THREAD->tid, CPU->id);
83
           
83
           
84
            for (i = 0; i < allocated; i++) {
84
            for (i = 0; i < allocated; i++) {
85
                for (k = 0; k <= (((index_t) FRAME_SIZE << order) - 1); k++) {
85
                for (k = 0; k <= (((size_t) FRAME_SIZE << order) - 1); k++) {
86
                    if (((uint8_t *) frames[i])[k] != val) {
86
                    if (((uint8_t *) frames[i])[k] != val) {
87
                        TPRINTF("Thread #%" PRIu64 " (cpu%u): Unexpected data (%c) in block %p offset %#" PRIi "\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
87
                        TPRINTF("Thread #%" PRIu64 " (cpu%u): Unexpected data (%c) in block %p offset %#" PRIs "\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
88
                        atomic_inc(&thread_fail);
88
                        atomic_inc(&thread_fail);
89
                        goto cleanup;
89
                        goto cleanup;
90
                    }
90
                    }
91
                }
91
                }
92
                frame_free(KA2PA(frames[i]));
92
                frame_free(KA2PA(frames[i]));