Home > OS >  The Linux kernel readb problem
The Linux kernel readb problem

Time:09-22

Macro implementation
# define readb (addr) \
({unsigned char __v=(* (volatile unsigned char *) (addr)); __v; })


Method of use
The static uint8_t nand_read_byte (struct mtd_info * MTD)
{
Struct nand_chip * chip=MTD - & gt; Priv;
Return readb (chip - & gt; IO_ADDR_R);
}

Functions can be confirmed is read a byte data from the address, the problem is C return can use?

Is equivalent to
Unsigned char __v=(* (volatile unsigned char *) (addr));
Return __v;
  • Related