Uclinux-2008r1-rc8 (bf561) to VDSP5 transplantation (in): Start_kernel

Source: Internet
Author: User

After the Head.s initialization is complete, it jumps to the Start_kernel function to continue, as follows:

JUMP.L _start_kernel;

The realization of Start_kernel in INIT/MAIN.C

asmlinkage void __init start_kernel (void)

This marks the start of the first phase of the end of the second phase of the beginning. But in VDSP, when you start debugging, the default stops at the first statement of the main function, so in order to satisfy VDSP's self-righteous, we change this jump to the main function and call Start_kernel in the main function:

JUMP.L _main;

and the main function becomes:

#include <config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/kernel.h>
#include <linux/syscalls.h>
#include <linux/string.h>
#include <linux/ctype.h>
/*****************************************************************************
* Core A
* coreA.c
*****************************************************************************/

asmlinkage void __init main( void )
{
/* The default startup code does not include any functionality to allow core
A to enable core B. A convenient way to enable core B is to use the
'adi_core_b_enable()' function. */
//adi_core_b_enable();

/* Begin adding your custom code here */
start_kernel();
}

Since Start_kernel becomes a function call here, it needs to change its declaration (include/linux/start_kernel.h) to read:

extern void __init start_kernel (void);

At the same time, change the implementation in INIT/MAIN.C to:

void __init start_kernel(void)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.