* what does it use two "!!"
@ 2013-04-01 7:13 Ben Wu
2013-04-01 7:18 ` anish singh
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ben Wu @ 2013-04-01 7:13 UTC (permalink / raw)
To: kernelnewbies
Dear All?
1> I found some placeuse two "!!", what's means
??? if(button->gpio != INVALID_GPIO)
??? ??? state = !!((gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low);
??? else
??? ??? state = !!button->adc_state;
2> is there some MSN group to study linux kernel or discuss it ?
Thanks and Best Regards
Ben Wu
MSN:crayben at yahoo.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130401/92c770c5/attachment.html
^ permalink raw reply [flat|nested] 6+ messages in thread* what does it use two "!!"
2013-04-01 7:13 what does it use two "!!" Ben Wu
@ 2013-04-01 7:18 ` anish singh
2013-04-01 13:47 ` Christopher Harvey
2013-04-01 23:36 ` Jonathan Neuschäfer
2 siblings, 0 replies; 6+ messages in thread
From: anish singh @ 2013-04-01 7:18 UTC (permalink / raw)
To: kernelnewbies
!! is generally used to make the return bool value.
You can use kernelnewbies and linux kernel mailing list.
On Mon, Apr 1, 2013 at 12:43 PM, Ben Wu <crayben@yahoo.cn> wrote:
>
>
> Dear All?
> 1> I found some placeuse two "!!", what's means
> if(button->gpio != INVALID_GPIO)
> state = !!((gpio_get_value(button->gpio) ? 1 : 0) ^
> button->active_low);
> else
> state = !!button->adc_state;
>
> 2> is there some MSN group to study linux kernel or discuss it ?
>
> Thanks and Best Regards
> Ben Wu
> MSN:crayben at yahoo.cn
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130401/57917fa7/attachment.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* what does it use two "!!"
2013-04-01 7:13 what does it use two "!!" Ben Wu
2013-04-01 7:18 ` anish singh
@ 2013-04-01 13:47 ` Christopher Harvey
2013-04-01 23:36 ` Jonathan Neuschäfer
2 siblings, 0 replies; 6+ messages in thread
From: Christopher Harvey @ 2013-04-01 13:47 UTC (permalink / raw)
To: kernelnewbies
Ben Wu writes:
> Dear All?
> 1> I found some placeuse two "!!", what's means
> if(button->gpio != INVALID_GPIO)
> state = !!((gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low);
> else
> state = !!button->adc_state;
if a = 1010011 then
!a = 0 and
!!a = 1
if a = 000000 then
!a = 1
!! = 0
basically it means if a is non-zero then make a = exactly 1, else leave
it at zero.
> 2> is there some MSN group to study linux kernel or discuss it ?
don't know, but it would be ironic.
> Thanks and Best Regards
>
> Ben Wu
>
> MSN:crayben at yahoo.cn
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 6+ messages in thread
* what does it use two "!!"
2013-04-01 7:13 what does it use two "!!" Ben Wu
2013-04-01 7:18 ` anish singh
2013-04-01 13:47 ` Christopher Harvey
@ 2013-04-01 23:36 ` Jonathan Neuschäfer
2 siblings, 0 replies; 6+ messages in thread
From: Jonathan Neuschäfer @ 2013-04-01 23:36 UTC (permalink / raw)
To: kernelnewbies
On Mon, Apr 01, 2013 at 03:13:06PM +0800, Ben Wu wrote:
> 2> is there some MSN group to study linux kernel or discuss it ?
> MSN:crayben at yahoo.cn
You seem to have a strange notion of "MSN". I guess you don't mean
"Microsoft Network" (which really is what MSN means much of the time),
but e-mail. If you do, then yes, there are a lot of mailing lists about
various aspects of the linux kernel, and kernelnewbies at kernelnewbies.org
is one of them.
Hope that helps,
Jonathan Neusch?fer
^ permalink raw reply [flat|nested] 6+ messages in thread
* pci_alloc_consistent doubt
@ 2013-04-01 4:12 Avinash Patil
2013-04-01 7:10 ` what does it use two "!!" Ben Wu
0 siblings, 1 reply; 6+ messages in thread
From: Avinash Patil @ 2013-04-01 4:12 UTC (permalink / raw)
To: kernelnewbies
AFAIK.
1) as we know pci_alloc_consistent allocates dma buffers which is visible
to DMA controller as well as CPU.
virt_add = pci_alloc_consistent(pdev, size, dma_addr_t bus_adrr);
here it will allocate a buffer and return its virtual address and
corresponding bus address.
My question is do these two address ultimately point to similar location
but from different perspectives ?.
Avinash: Yes both virtual and physical addresses point to same location.
BAR at the enumeration of PCI devices allocates specific address for PCI
devices from RAM and your alloc_consistent uses these addresses.
2) After allocating these address, how do we proceed given that i have a
ASIC register which has the dma_rx_desc_start address ?
Avinash: Here is a link which can help you for creating rings, creating
your ISR which handles different vendor specific interrupts etc
http://netsecinfo.blogspot.in/search?q=PCIe
Avinash:
3) Also does all the HW's which support dma have the descriptor data
structures by provided by Vender or is there any specific format that dev
has to be aware of for designing such descriptor for that particular driver
?
Avinash: These structures are vendor specific which may contain physical
address, length etc.
On Thu, Mar 28, 2013 at 1:14 AM, Dhananjay Maske <
dhananjay.maske87@gmail.com> wrote:
> Hi All,
> I am fairly New to Linux kernel Programming and i have few questions
> with respect to pci_alloc_consistent .
>
> 1) as we know pci_alloc_consistent allocates dma buffers which is visible
> to DMA controller as well as CPU.
> virt_add = pci_alloc_consistent(pdev, size, dma_addr_t bus_adrr);
>
> here it will allocate a buffer and return its virtual address and
> corresponding bus address.
>
> My question is do these two address ultimately point to similar location
> but from different perspectives ?.
>
> 2) After allocating these address, how do we proceed given that i have a
> ASIC register which has the dma_rx_desc_start address ?
>
> 3) Also does all the HW's which support dma have the descriptor data
> structures by provided by Vender or is there any specific format that dev
> has to be aware of for designing such descriptor for that particular driver
> ?
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130401/134f5032/attachment.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-04-01 23:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-01 7:13 what does it use two "!!" Ben Wu
2013-04-01 7:18 ` anish singh
2013-04-01 13:47 ` Christopher Harvey
2013-04-01 23:36 ` Jonathan Neuschäfer
-- strict thread matches above, loose matches on Subject: below --
2013-04-01 4:12 pci_alloc_consistent doubt Avinash Patil
2013-04-01 7:10 ` what does it use two "!!" Ben Wu
2013-04-01 9:37 ` Valdis.Kletnieks at vt.edu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).