Project

General

Profile

Revision 138

input checkers

View differences:

graphics.c
36 36
    reg_86.es = PB2BASE(mem_map.phys);
37 37
    reg_86.di = PB2OFF(mem_map.phys);
38 38
    // BIOS CALL
39
    if (sys_int86(&reg_86)) {
39
    if (sys_int86(&reg_86) || reg_86.ah != AH_SUCCESS) {
40 40
        printf("%s: sys_int86 failed\n", __func__);
41 41
        if (free_memory_map()) {
42 42
            printf("%s: lm_free failed\n", __func__);
43
            return LCF_ERROR;
44 43
        }
45 44
        return BIOS_CALL_ERROR;
46 45
    }
......
73 72
    reg_86.es = PB2BASE(controller_map.phys);
74 73
    reg_86.di = PB2OFF(controller_map.phys);
75 74
    // BIOS CALL
76
    if (sys_int86(&reg_86)) {
75
    if (sys_int86(&reg_86) || reg_86.ah != AH_SUCCESS) {
77 76
        printf("%s: sys_int86 failed\n", __func__);
78
        if (free_memory_map()) {
77
        if (!lm_free(&controller_map)) {
79 78
            printf("%s: lm_free failed\n", __func__);
80
            return LCF_ERROR;
81 79
        }
82 80
        return BIOS_CALL_ERROR;
83 81
    }
......
117 115
    virtual_ptr = phys_ptr + virtual_base;
118 116
    info_p->OEMProductRevPtr = (char*)(virtual_ptr);
119 117

  
120
    lm_free(&controller_map);
118
    if (!lm_free(&controller_map)) {
119
        printf("%s: lm_free failed\n", __func__);
120
        return LCF_ERROR;
121
    }
121 122

  
122

  
123

  
124

  
125 123
    return SUCCESS;
126 124
}
127 125

  
......
157 155
    int r;
158 156
    unsigned int vram_base = get_phys_addr();
159 157
    unsigned int vram_size = get_vram_size();
160
    if ((r = get_permission(vram_base, vram_size)))
158
    if ((r = get_permission(vram_base, vram_size))) {
159
        if (free_memory_map()) {
160
            printf("%s: lm_free failed\n", __func__);
161
        }
161 162
        panic("%s: sys_privctl (ADD MEM) failed: %d\n", __func__, r);
163
    }
162 164

  
163 165
    video_mem = vm_map_phys(SELF, (void *)vram_base, vram_size);
164 166

  
165
    if (video_mem == MAP_FAILED)
167
    if (video_mem == MAP_FAILED) {
168
        if (free_memory_map()) {
169
            printf("%s: lm_free failed\n", __func__);
170
        }
166 171
        panic("%s: couldn't map video memory.", __func__);
172
    }
167 173

  
168 174
    return SUCCESS;
169 175
}
......
184 190
    reg_86.bx = mode | LINEAR_FRAME_BUFFER_MD;
185 191

  
186 192
    // BIOS CALL
187
    if (sys_int86(&reg_86)) {
193
    if (sys_int86(&reg_86) || reg_86.ah != AH_SUCCESS) {
188 194
        printf("%s: sys_int86 failed\n", __func__);
189 195
        return BIOS_CALL_ERROR;
190 196
    }

Also available in: Unified diff