Transplantation of Uclinux-2008r1-rc8 (bf561) to VDSP5: current_text_addr

Source: Internet
Author: User

There is a definition in include/asm/processor.h:

/*
 * Default implementation of macro that returns current
 * instruction pointer ("program counter").
 */
#define current_text_addr() ({ __label__ _l; _l: &&_l;})

Its role is to take the value of the current PC, but this line of statements will cause an error under VDSP:

../../security/commoncap.c
"../../include/linux/skbuff.h", line 897: cc1454: error: taking the address
of a label is not a supported feature
skb_over_panic(skb, len, current_text_addr());
^
"../../include/linux/skbuff.h", line 922: cc1454: error: taking the address
of a label is not a supported feature
skb_under_panic(skb, len, current_text_addr());
^
2 errors detected in the compilation of "../../security/commoncap.c".
cc3089: fatal error: Compilation failed
Tool failed with exit/exception code: 1.
Build was unsuccessful.

Make the following modifications to it:

static inline unsigned long current_text_addr(void)
{
 unsigned long pc;

  __asm__ __volatile__("%0 = rets;/n/t":"=d"(pc));
 return pc;
}

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.