Reputation: 46
int alpharomeo_probe(struct tty_struct *tty, uint32_t *arg)
{
((uint32_t *)arg) = 0xdeadbeef; // This line
<more code>
}
Upvotes: 0
Views: 399
Reputation: 46
Ans:- Points to a 4-byte location containing the argument. Second line is setting that value to deadbeef
Upvotes: 0
Reputation: 3962
0xDEADBEEF ("dead beef") is frequently used to indicate a software crash or deadlock in embedded systems. DEADBEEF was originally used to mark newly allocated areas of memory that had not yet been initialized -- when scanning a memory dump, it is easy to see the DEADBEEF. It is used by IBM RS/6000 systems, Mac OS on 32-bit PowerPC processors and the Commodore Amiga as a magic debug value. On Sun Microsystems' Solaris, it marks freed kernel memory. On OpenVMS running on Alpha processors, DEAD_BEEF can be seen by pressing CTRL-T. The DEC Alpha SRM console has a background process that traps memory errors, identified by PS as "BeefEater waiting on 0xdeadbeef".
So take it as arg = NULL; Anyway, I am interested to know where the code comes from.
Upvotes: 2
Reputation: 628
Well in the context of that code it doesn't really mean anything. That sort of syntax would suggest that arg is being casted to a pointer to 32bit unsigned int type, however in that example it is appearing in the place of an lvalue where a cast obviously would not be relevant. So it would lead me to believe that it is a declaration from an overzealous parenthesis user, declaring a variable called arg which is a pointer to the uint32 type. However, arg is already declared. SO i would guess that the variable name was copied wrong or it is on the wrong side of the parenthesis.
Upvotes: 0