Uclinux-2008r1-rc8 (bf561) to VDSP5 transplantation (one): Cmdline_init

Source: Internet
Author: User

In Head.s, there is such a call:

/* Pass the Uboot arguments to the global value command
R0 = R7;
Call _cmdline_init;

In fact, it is to save the parameters passed by the u-boot, and transmit them to the corresponding modules at the appropriate time (see "U-boot to Uclinux"). Because it does not use a bootstrapper such as U-boot, it is directed directly, so the appropriate modifications are made.

First look at the implementation of Cmdline_init, this function in Arch/blackfin/kernel/setup.c (714):

Char __initdata command_line[command_line_size];

void __init cmdline_init (const char *r0)
{
if (R0)
strncpy (Command_line, R0, command_line_size);
}

It's very simple to save the parameters and then analyze the parameters in the process of starting later.

I wanted to put the parameter definition in Config.h, but in this case, each modification of the parameter necessarily caused the entire kernel to recompile, too painful, so directly replace the string to save the parameter r0.

void __init cmdline_init (const char *r0)
{
if (R0)
strncpy (Command_line, R0, command_line_size);
if (R0)
strncpy (Command_line, "", command_line_size);
}

An empty string is temporarily used, and the content is added later.

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.