LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I opened a header file .There i saw some macros but i don't know where have come from.Could you help me to know those macros and their sourc (https://www.linuxquestions.org/questions/linux-newbie-8/i-opened-a-header-file-there-i-saw-some-macros-but-i-dont-know-where-have-come-from-could-you-help-me-to-know-those-macros-and-their-sourc-4175638435/)

abdullah bin khaled 09-15-2018 03:07 AM

I opened a header file .There i saw some macros but i don't know where have come from.Could you help me to know those macros and their sourc
 
1 Attachment(s)
Attachment 28601
what does #define ACPI_PLD_GET_REVISION(dword) ACPI_GET_BITS (dword, 0, ACPI_7BIT_MASK) mean

berndbausch 09-15-2018 04:58 AM

Their source is the header file acbuffer.h. They seem to be related to the management and usage of ACPI. If you want to know what they are for, you might get information from the kernel documentation.

berndbausch 09-19-2018 12:11 AM

Quote:

Originally Posted by abdullah bin khaled (Post 5903542)
Attachment 28601
what does #define ACPI_PLD_GET_REVISION(dword) ACPI_GET_BITS (dword, 0, ACPI_7BIT_MASK) mean

There is a macro named ACPI_GET_BITS, which takes three parameters. ACPI_PLD_GET_REVISION is another macro, which calls ACPI_GET_BITS and sets two of its parameters to constant values.

From their naming, I guess that ACPI_GET_BITS is a general lookup function that gets certain bits from its dword input. ACPI_PLD_GET_REVISION then retrieves those bits that indicate the ACPI PLD revision.

A bit closer to the beginning of the file, you see that struct acpi_pld_info does contain a revision in its first byte. Also note the comment in the same file that these macros convert a _PLD buffer to internal ACPI_PLD_INFO format.

Unfortunately, I don’t know what ACPI PLD stands for, but I am sure Google does.

Why do you want to know these details?

abdullah bin khaled 09-19-2018 08:28 AM

Quote:

Originally Posted by berndbausch (Post 5905157)
There is a macro named ACPI_GET_BITS, which takes three parameters. ACPI_PLD_GET_REVISION is another macro, which calls ACPI_GET_BITS and sets two of its parameters to constant values.

From their naming, I guess that ACPI_GET_BITS is a general lookup function that gets certain bits from its dword input. ACPI_PLD_GET_REVISION then retrieves those bits that indicate the ACPI PLD revision.

A bit closer to the beginning of the file, you see that struct acpi_pld_info does contain a revision in its first byte. Also note the comment in the same file that these macros convert a _PLD buffer to internal ACPI_PLD_INFO format.

Unfortunately, I don’t know what ACPI PLD stands for, but I am sure Google does.

Why do you want to know these details?

I am new in programming .I think it will be easier to be a good programmer (like you and many other) if i know how other programmer build the whole system. please pardon me for my bad english and for my style of writing.but for people like you i am sure one day i will be a good programmer .

berndbausch 09-19-2018 05:35 PM

Quote:

Originally Posted by abdullah bin khaled (Post 5905273)
I am new in programming .I think it will be easier to be a good programmer (like you and many other) if i know how other programmer build the whole system. please pardon me for my bad english and for my style of writing.but for people like you i am sure one day i will be a good programmer .

Your English is more than adequate. Better than many.

It's laudable that you want to understand the Linux kernel in order to gain programming skills, but I am afraid the code you picked is too advanced for a beginner. It's very close to the hardware and needs to solve very peculiar problems. Perhaps the Linux kernel in general is not the right example for a beginner.

Unfortunately, I am not a programmer and don't have suggestions which project to study instead. After a bit of googling I stumbled on this list. Give it a try and persevere.


All times are GMT -5. The time now is 04:51 AM.