����14-23 linux/include/linux/kernel.h


  1 /*

  2  * 'kernel.h' contains some often-used function prototypes etc

  3  */

    /*

     * 'kernel.h'������һЩ���ú�����ԭ�͵ȡ�

     */

    // ��֤������ַ��ʼ���ڴ���Ƿ��ޡ���������׷���ڴ档( kernel/fork.c, 24 )��

  4 void verify_area(void * addr,int count);

    // ��ʾ�ں˳�����Ϣ��Ȼ�������ѭ����( kernel/panic.c, 16 )��

    // ������ǰ�Ĺؼ���volatile���ڸ��߱�����gcc�ú������᷵�ء���������gcc��������

    // һЩ�Ĵ��룬����Ҫ����ʹ������ؼ��ֿ��Ա������ijδ��ʼ�������ļپ�����Ϣ��

  5 volatile void panic(const char * str);

    // �����˳��������� kernel/exit.c��262 ����

  6 volatile void do_exit(long error_code);

    // ��׼��ӡ����ʾ��������( init/main.c, 151)��

  7 int printf(const char * fmt, ...);

    // �ں�ר�õĴ�ӡ��Ϣ������������printf()��ͬ��( kernel/printk.c, 21 )��

  8 int printk(const char * fmt, ...);

    // ����̨��ʾ�������� kernel/chr_drv/console.c��995����

  9 void console_print(const char * str);

    // ��tty��дָ�����ȵ��ַ�����( kernel/chr_drv/tty_io.c, 290 )��

 10 int tty_write(unsigned ch,char * buf,int count);

    // ͨ���ں��ڴ���亯����( lib/malloc.c, 117)��

 11 void * malloc(unsigned int size);

    // �ͷ�ָ������ռ�õ��ڴ档( lib/malloc.c, 182)��

 12 void free_s(void * obj, int size);

    // Ӳ�̴�����ʱ����kernel/blk_drv/hd.c��318����

 13 extern void hd_times_out(void);

    // ֹͣ��������kernel/chr_drv/console.c��944����

 14 extern void sysbeepstop(void);

    // ������������kernel/chr_drv/console.c��981����

 15 extern void blank_screen(void);

    // �ָ�����������Ļ����kernel/chr_drv/console.c��988����

 16 extern void unblank_screen(void);

 17

 18 extern int beepcount;              // ����ʱ����઼�����kernel/chr_drv/console.c��988����

 19 extern int hd_timeout;             // Ӳ�̳�ʱ�δ�ֵ��kernel/blk_drv/blk.h����

 20 extern int blankinterval;          // �趨����Ļ�������ʱ�䡣

 21 extern int blankcount;             // ����ʱ�������kernel/chr_drv/console.c��138��139����

 22

 23 #define free(x) free_s((x), 0)

 24

 25 /*

 26  * This is defined as a macro, but at some point this might become a

 27  * real subroutine that sets a flag if it returns true (to do

 28  * BSD-style accounting where the process is flagged if it uses root

 29  * privs).  The implication of this is that you should do normal

 30  * permissions checks first, and check suser() last.

 31  */

    /*

     * ���溯�����Ժ����ʽ����ģ�������ij�������������Գ�Ϊһ���������ӳ���

     * ���������trueʱ�������ñ�־�����ʹ��root�û�Ȩ�޵Ľ��������˱�־������

     * ��ִ��BSD��ʽ�ļ��ʴ�����������ζ����Ӧ������ִ�г���Ȩ�޼�飬�����

     * ���suser()��

     */

 32 #define suser() (current->euid == 0)             // ����Ƿ��dz����û���

 33