lkdebug.h (1339B)
1 /* lkdebug.h 2 * 3 * Copyright 2015 Brian Swetland <swetland@frotz.net> 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 #ifndef _LKDEBUG_H_ 19 #define _LKDEBUG_H_ 20 21 typedef struct lkthread { 22 struct lkthread *next; 23 int active; 24 u32 threadptr; 25 u32 nextptr; 26 u32 state; 27 u32 saved_sp; 28 u32 preempted; 29 u32 waitq; 30 char name[32]; 31 u32 regs[17]; 32 } lkthread_t; 33 34 // probe target for lk thread info 35 lkthread_t *find_lk_threads(int verbose); 36 37 void dump_lk_thread(lkthread_t *t); 38 void dump_lk_threads(lkthread_t *t); 39 void free_lk_threads(lkthread_t *list); 40 lkthread_t *find_lk_thread(lkthread_t *list, u32 tptr); 41 void get_lk_thread_name(lkthread_t *t, char *out, size_t max); 42 43 // Invalidate current thread and threadlist 44 // Intended for use after target reset, etc. 45 // Will corrupt a running image. 46 void clear_lk_threads(void); 47 48 #endif