x86 Assembly: cli leads to "Memory fault (core dumped)"

Greetings,

i tried to call ‘CLI’ at an assembly funktion and ment to disable task
switching with it, but i produced a core dump…

The code looks like:
pushf
cli
; some instructions
popf

The problem is that i have to do some performance measuring and i have to be
sure that nothing interrupts my task, but i dont know how.
I would be grateful if somebody could post some explanations on disabling
interrupts in asm-funktions.

Thx in advance,
Mike

I would do your initial setup in C and then call the assembly code you
are interrested in profiling. The functions you need to call are
ThreadCtrl and InterruptDisable.

chris

Mike <just.me@aon.at> wrote:

Greetings,

i tried to call ‘CLI’ at an assembly funktion and ment to disable task
switching with it, but i produced a core dump…

The code looks like:
pushf
cli
; some instructions
popf

The problem is that i have to do some performance measuring and i have to be
sure that nothing interrupts my task, but i dont know how.
I would be grateful if somebody could post some explanations on disabling
interrupts in asm-funktions.

Thx in advance,
Mike
\

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Mike <just.me@aon.at> wrote:

i tried to call ‘CLI’ at an assembly funktion and ment to disable task
switching with it, but i produced a core dump…

You’re lacking privity to make that call - take a look at the help docs
under InterruptDisable() → you could call the C function directly from
your assembler code.

-Adam
amallory@qnx.com

“Chris McKillop” <cdm@qnx.com> wrote in message
news:9npnft$l33$1@nntp.qnx.com

I would do your initial setup in C and then call the assembly code you
are interrested in profiling. The functions you need to call are
ThreadCtrl and InterruptDisable.

You must run this as root as well. cli is a priviledge intruction. I

wouldn’t be a good idea to let anybody run a program that can disable
interrupts.

chris

Mike <> just.me@aon.at> > wrote:

Greetings,

i tried to call ‘CLI’ at an assembly funktion and ment to disable task
switching with it, but i produced a core dump…

The code looks like:
pushf
cli
; some instructions
popf

The problem is that i have to do some performance measuring and i have
to be
sure that nothing interrupts my task, but i dont know how.
I would be grateful if somebody could post some explanations on
disabling
interrupts in asm-funktions.

Thx in advance,
Mike



\

cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL