lkcd
[Top] [All Lists]

Re: setpriority kernel mod test doesn't compile

To: Brian Hall <brianw.hall@xxxxxxxxxx>
Subject: Re: setpriority kernel mod test doesn't compile
From: Matt Robinson <yakker@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 4 Nov 1999 15:45:01 -0800 (PST)
Cc: lkcd@xxxxxxxxxxx
In-reply-to: <XFMail.991104161106.brianw.hall@compaq.com>
Reply-to: Matt Robinson <yakker@xxxxxxxxxxxxxxxxxxxx>
Sender: owner-lkcd@xxxxxxxxxxx
It's just a little hack to create an exception panic.  You can
accomplish the same thing with the call that Scott mentioned
earlier:

        char *a = (char *)0x0;

        *a = 0;

So just replace the __asm__ call with the stuff above.  I'm surprised
you weren't able to compile -- I've been copying that code in for a
long time, and haven't had any problem whatsoever.

--Matt

On Thu, 4 Nov 1999, Brian Hall wrote:
|>I modified sys_setpriority as shown in the FAQ, but the kernel compile fails:
|>
|>sys.c: In function `sys_setpriority':
|>sys.c:92: parse error before `}'
|>sys.c:78: warning: unused variable `error'
|>sys.c:77: warning: unused variable `priority'
|>sys.c:76: warning: unused variable `p'
|>sys.c:93: warning: control reaches end of non-void function
|>sys.c: At top level:
|>sys.c:97: warning: type defaults to `int' in declaration of `error'
|>sys.c:97: warning: data definition has no type or storage class
|>sys.c:98: warning: type defaults to `int' in declaration of `priority'
|>sys.c:98: `niceval' undeclared here (not in a function)
|>sys.c:98: warning: data definition has no type or storage class
|>sys.c:99: parse error before `if'
|>sys.c:103: warning: type defaults to `int' in declaration of `priority'
|>sys.c:103: redefinition of `priority'
|>sys.c:98: `priority' previously defined here
|>sys.c:103: initializer element is not constant
|>sys.c:103: warning: data definition has no type or storage class
|>sys.c:105: parse error before `if'
|>sys.c:112: parse error before `='
|>make[2]: *** [sys.o] Error 1
|>make[2]: Leaving directory `/usr/src/linux-2.2.13/kernel'
|>make[1]: *** [first_rule] Error 2
|>make[1]: Leaving directory `/usr/src/linux-2.2.13/kernel'
|>make: *** [_dir_kernel] Error 2
|>
|>
|>Also, the panic call is pretty obvious, but what does the assembler do?
|>
|>--
|>Brian Hall <brianw.hall@xxxxxxxxxx>
|>Linux Consultant
|>



<Prev in Thread] Current Thread [Next in Thread>