| 164 | |
| 165 | |
| 166 | static void event_table_dump() |
| 167 | { |
| 168 | /************************************** |
| 169 | * |
| 170 | * e v e n t _ t a b l e _ d u m p |
| 171 | * |
| 172 | ************************************** |
| 173 | * |
| 174 | * Functional description |
| 175 | * Dump the contents of the event table. |
| 176 | * This format exactly matches what's in the event table and |
| 177 | * is not very readable by humans. |
| 178 | * |
| 179 | **************************************/ |
| 180 | |
| 181 | printf("%.5d GLOBAL REGION HEADER\n", 0); |
| 182 | printf("\tLength: %ld, version: %d, free: %ld, current: %ld, request_id: %ld\n", |
| 183 | EVENT_header->evh_length, EVENT_header->evh_version, |
| 184 | EVENT_header->evh_free, EVENT_header->evh_current_process, |
| 185 | EVENT_header->evh_request_id); |
| 186 | |
| 187 | prt_que("\tProcesses", &EVENT_header->evh_processes); |
| 188 | prt_que("\tEvents", &EVENT_header->evh_events); |
| 189 | |
| 190 | for (SLONG offset = sizeof(evh); offset < EVENT_header->evh_length; offset += block->hdr_length) |
| 191 | { |
| 192 | printf("\n%.5ld ", offset); |
| 193 | const event_hdr* block = (event_hdr*) SRQ_ABS_PTR(offset); |
| 194 | switch (block->hdr_type) |
| 195 | { |
| 196 | case type_prb: |
| 197 | { |
| 198 | printf("PROCESS_BLOCK (%ld)\n", block->hdr_length); |
| 199 | const prb* process = (prb*) block; |
| 200 | printf("\tFlags: %d, pid: %d\n", process->prb_flags, process->prb_process_id); |
| 201 | prt_que("\tProcesses", &process->prb_processes); |
| 202 | prt_que("\tSessions", &process->prb_sessions); |
| 203 | } |
| 204 | break; |
| 205 | |
| 206 | case type_frb: |
| 207 | { |
| 208 | printf("FREE BLOCK (%ld)\n", block->hdr_length); |
| 209 | const frb* free = (frb*) block; |
| 210 | printf("\tNext: %ld\n", free->frb_next); |
| 211 | } |
| 212 | break; |
| 213 | |
| 214 | case type_reqb: |
| 215 | { |
| 216 | printf("REQUEST BLOCK (%ld)\n", block->hdr_length); |
| 217 | const evt_req* request = (evt_req*) block; |
| 218 | printf("\tProcess: %ld, interests: %ld, ast: %lx, arg: %lx\n", |
| 219 | request->req_process, request->req_interests, |
| 220 | request->req_ast, request->req_ast_arg); |
| 221 | printf("\tRequest id: %ld\n", request->req_request_id); |
| 222 | prt_que("\tRequests", &request->req_requests); |
| 223 | } |