Skip to contentSkip to conversation

user_mode() right?

parisc-linux Grant Grundler 2 participants 2 messages Jul 5, 2002

lore
Share & tools
lore
#0 lore raw

Hi all,
top currently reports the following on my a500:
CPU states: 0.3% user, 99.7% system, 0.0% nice, 0.0% idle

while the system is idle. ie idle time is being accounted to the system time.

While trying to understand this, I ran across the following comment:

/* XXX should we use iaoq[1] or iaoq[0] ? */
#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0)

Is iaoq[0] correct?

thanks
grant

#1 lore raw
Quoted 6 lines · Grant Grundler

While trying to understand this, I ran across the following comment:

/* XXX should we use iaoq[1] or iaoq[0] ? */
#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0)

Is iaoq[0] correct?

I'd've thought so. iaoq[0] is what instruction are we executing' and iaoq[1] is where are we going next'. the only time they're going to be different is when we're about to enter the kernel or about to return to userspace. in either case, it's nothing more than an out-by-one error at worst.

Signature · 1 line
Revolutions do not require corporate support.