Change kbdb's kthr::cpu field into an int, to avoid gcc warnings about

comparing it with NOCPU, which became -1 recently.  While here, avoid
using it for address calculations if it is negative.

Reviewed by:	jhb, adrian
MFC after:	1 week
This commit is contained in:
Dimitry Andric 2014-11-11 18:54:57 +00:00
parent 858b72dbb8
commit 7a3659bcac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274391
2 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ struct kthr {
uintptr_t pcb;
int tid;
int pid;
u_char cpu;
int cpu;
};
extern struct kthr *curkthr;

View File

@ -139,7 +139,7 @@ kgdb_trgt_fetch_tss(void)
uintptr_t addr, cpu0prvpage, tss;
kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
if (kt == NULL || kt->cpu == NOCPU)
if (kt == NULL || kt->cpu == NOCPU || kt->cpu < 0)
return (0);
addr = kgdb_lookup("gdt");