LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-24-2015, 08:58 AM   #1
superNewbie
LQ Newbie
 
Registered: Mar 2015
Posts: 4

Rep: Reputation: Disabled
((FIRST_EXTERNAL_VECTOR + 16) & ~15) irq_vectors.h


Hi,

This code is in line 58:
http://lxr.free-electrons.com/source.../irq_vectors.h

I don't understand why & ~15. Could someone explain me, please?
I don't know why he didn't simply used FIRST_EXTERNAL_VECTOR + 16, which gives the same value (?)

Code:
#include <stdio.h>

#define FEV 0x20

int main(int argc, char * argv[])
{
    printf("%d\n", ~15); // 0000b
    printf("%d\n", 16 & ~15); // 16
    printf("%d\n", (FEV + 16)); // 48; 0x30; 11 0000b
    printf("%d\n", (FEV + 16) & ~15); // 48; 0x30; 11 0000b

    return 0;
}
 
Old 08-24-2015, 09:15 AM   #2
superNewbie
LQ Newbie
 
Registered: Mar 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled


That's ok.
It gives the same result in this case, but if FIRST_EXTERNAL_VECTOR changes (0x21 for example), then & ~15 is important.

 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: RDO Kilo Set up for three F22 VM Nodes Controller&Network&Compute (ML2&OVS&VXLAN) LXer Syndicated Linux News 0 05-31-2015 07:22 AM
irq_vectors.h not found tilman1 Linux - Kernel 9 09-01-2010 05:22 PM
AOL UK && BT Voyager 100 && Slackware 10.2 && RP-PPPoE pitt0071 Linux - Networking 3 01-17-2006 06:10 AM
Japanese canna won't work : Warning: &#12363;&#12394;&#28450;&#23383;&#22793;&am OrganicOrange84 Debian 3 06-30-2005 02:28 PM
Ph&#7909;c h&#7891;i d&#7919; li&#7879;u b&#7883; m&#7845;t???, c&#7913; pollsite General 1 06-27-2005 12:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration