Project

General

Profile

Revision 133

changed free_memory name

View differences:

lab5/graphics.c
38 38
    // BIOS CALL
39 39
    if (sys_int86(&reg_86)) {
40 40
        printf("%s: sys_int86 failed\n", __func__);
41
        if (free_memory()) {
41
        if (free_memory_map()) {
42 42
            printf("%s: lm_free failed\n", __func__);
43 43
            return LCF_ERROR;
44 44
        }
......
75 75
    // BIOS CALL
76 76
    if (sys_int86(&reg_86)) {
77 77
        printf("%s: sys_int86 failed\n", __func__);
78
        if (free_memory()) {
78
        if (free_memory_map()) {
79 79
            printf("%s: lm_free failed\n", __func__);
80 80
            return LCF_ERROR;
81 81
        }
......
168 168
    return SUCCESS;
169 169
}
170 170

  
171
int (free_memory)(void) {
171
int (free_memory_map)(void) {
172 172
    return !lm_free(&mem_map);
173 173
}
174 174

  
lab5/graphics.h
59 59

  
60 60
int (map_vram)(void);
61 61

  
62
int (free_memory)(void);
62
int (free_memory_map)(void);
63 63

  
64 64
int (set_pixel)(uint16_t row, uint16_t col, uint32_t color);
65 65

  
lab5/lab5.c
61 61

  
62 62
    if (vg_exit()) {
63 63
        printf("%s: vg_exit failed to exit to text mode.\n", __func__);
64
        if (free_memory())
64
        if (free_memory_map())
65 65
            printf("%s: lm_free failed\n", __func__);
66 66
        return 1;
67 67
    }
68 68

  
69
    if (free_memory()) {
69
    if (free_memory_map()) {
70 70
        printf("%s: lm_free failed\n", __func__);
71 71
        return 1;
72 72
    }
......
96 96
    if (vg_draw_rectangle(x, y, width, height, color)) {
97 97
        if (vg_exit()) {
98 98
            printf("%s: vg_exit failed to exit to text mode.\n", __func__);
99
            if (free_memory()) printf("%s: lm_free failed\n", __func__);
99
            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
100 100
        }
101 101
        return 1;
102 102
    }
......
111 111
    if (subscribe_kbc_interrupt(kbc_irq_bit, &kbc_id)) {
112 112
        if (vg_exit()) {
113 113
            printf("%s: vg_exit failed to exit to text mode.\n", __func__);
114
            if (free_memory()) printf("%s: lm_free failed\n", __func__);
114
            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
115 115
        }
116 116
        return 1;
117 117
    }
......
142 142
    if (unsubscribe_interrupt(&kbc_id)) {
143 143
        if (vg_exit()) {
144 144
            printf("%s: vg_exit failed to exit to text mode.\n", __func__);
145
            if (free_memory()) printf("%s: lm_free failed\n", __func__);
145
            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
146 146
        }
147 147
        return 1;
148 148
    };
149 149

  
150 150
    if (vg_exit()) {
151 151
        printf("%s: vg_exit failed to exit to text mode.\n", __func__);
152
        if (free_memory()) printf("%s: lm_free failed\n", __func__);
152
        if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
153 153
        return 1;
154 154
    }
155 155

  
156
    if (free_memory()) {
156
    if (free_memory_map()) {
157 157
        printf("%s: lm_free failed\n", __func__);
158 158
        return 1;
159 159
    }
......
196 196
            if (vg_draw_rectangle(col*W,row*H,W,H,color)) {
197 197
                if (vg_exit()) {
198 198
                    printf("%s: vg_exit failed to exit to text mode.\n", __func__);
199
                    if (free_memory()) printf("%s: lm_free failed\n", __func__);
199
                    if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
200 200
                }
201 201
                return 1;
202 202
            }
......
212 212
    if (subscribe_kbc_interrupt(kbc_irq_bit, &kbc_id)) {
213 213
        if (vg_exit()) {
214 214
            printf("%s: vg_exit failed to exit to text mode.\n", __func__);
215
            if (free_memory()) printf("%s: lm_free failed\n", __func__);
215
            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
216 216
        }
217 217
        return 1;
218 218
    }
......
243 243
    if (unsubscribe_interrupt(&kbc_id)) {
244 244
        if (vg_exit()) {
245 245
            printf("%s: vg_exit failed to exit to text mode.\n", __func__);
246
            if (free_memory()) printf("%s: lm_free failed\n", __func__);
246
            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
247 247
        }
248 248
        return 1;
249 249
    };
250 250

  
251 251
    if (vg_exit()) {
252 252
        printf("%s: vg_exit failed to exit to text mode.\n", __func__);
253
        if (free_memory()) printf("%s: lm_free failed\n", __func__);
253
        if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
254 254
        return 1;
255 255
    }
256 256

  
257
    if (free_memory()) {
257
    if (free_memory_map()) {
258 258
        printf("%s: lm_free failed\n", __func__);
259 259
        return 1;
260 260
    }
......
294 294
    if (subscribe_kbc_interrupt(kbc_irq_bit, &kbc_id)) {
295 295
        if (vg_exit()) {
296 296
            printf("%s: vg_exit failed to exit to text mode.\n", __func__);
297
            if (free_memory()) printf("%s: lm_free failed\n", __func__);
297
            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
298 298
        }
299 299
        return 1;
300 300
    }
......
325 325
    if (unsubscribe_interrupt(&kbc_id)) {
326 326
        if (vg_exit()) {
327 327
            printf("%s: vg_exit failed to exit to text mode.\n", __func__);
328
            if (free_memory()) printf("%s: lm_free failed\n", __func__);
328
            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
329 329
        }
330 330
        return 1;
331 331
    };
332 332

  
333 333
    if (vg_exit()) {
334 334
        printf("%s: vg_exit failed to exit to text mode.\n", __func__);
335
        if (free_memory()) printf("%s: lm_free failed\n", __func__);
335
        if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
336 336
        return 1;
337 337
    }
338 338

  
339
    if (free_memory()) {
339
    if (free_memory_map()) {
340 340
        printf("%s: lm_free failed\n", __func__);
341 341
        return 1;
342 342
    }
......
379 379
    if (subscribe_kbc_interrupt(kbc_irq_bit, &kbc_id)) {
380 380
        if (vg_exit()) {
381 381
            printf("%s: vg_exit failed to exit to text mode.\n", __func__);
382
            if (free_memory()) printf("%s: lm_free failed\n", __func__);
382
            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
383 383
        }
384 384
        return 1;
385 385
    }
......
449 449
    if (unsubscribe_interrupt(&kbc_id)) {
450 450
        if (vg_exit()) {
451 451
            printf("%s: vg_exit failed to exit to text mode.\n", __func__);
452
            if (free_memory()) printf("%s: lm_free failed\n", __func__);
452
            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
453 453
        }
454 454
        return 1;
455 455
    };
456 456

  
457 457
    if (vg_exit()) {
458 458
        printf("%s: vg_exit failed to exit to text mode.\n", __func__);
459
        if (free_memory()) printf("%s: lm_free failed\n", __func__);
459
        if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
460 460
        return 1;
461 461
    }
462 462

  
463
    if (free_memory()) {
463
    if (free_memory_map()) {
464 464
        printf("%s: lm_free failed\n", __func__);
465 465
        return 1;
466 466
    }

Also available in: Unified diff