![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Programming Pointers
Big_Huang_JS
这个作者很懒,什么都没留下…
展开
-
Volatile as a promise
Dan Saks 1/4/2006 8:12 PM ESTLast time around, I advised you to place the volatile qualifier where it most accurately models the behavior of your hardware.1 In justifying that advice, I mentioned that for any type T, both C and C++ provide a standard (buil转载 2011-03-15 16:06:00 · 902 阅读 · 0 评论 -
More ways to map memory
Dan Saks 12/14/2004 4:18 PM ESTThe most elegant and pleasing notation might not be the most efficient one.<br />This is the third in a series of articles on accessing memory-mapped device registers using C and C++. In my previous column (November 2004), I转载 2011-03-16 19:49:00 · 717 阅读 · 0 评论 -
Mapping memory efficiently
Dan Saks 10/20/2004 3:00 PM EDTHow you define pointers to memory-mapped device registers can have an impact on the efficiency of your device drivers.<br />Many processors use memory-mapped I/O, which maps device registers to fixed addresses in the conventi转载 2011-03-16 19:48:00 · 555 阅读 · 0 评论 -
Mapping memory
Dan Saks 8/11/2004 11:00 AM EDTMemory-mapped I/O is something you can do reasonably well in standard C and C++.Device drivers communicate with peripheral devices through device registers. A driver sends commands or data to a device by storing into its devi转载 2011-03-16 19:47:00 · 957 阅读 · 0 评论 -
Use volatile judiciously
Dan Saks 9/7/2005 7:01 PM EDTAccording to the syntax rules of C and C++, the keyword volatile can appear anywhere that the keyword const can. Whereas a const object is one whose value the program can't change, a volatile object is one whose value might cha转载 2011-03-15 16:01:00 · 648 阅读 · 0 评论 -
Catching errors early with compile-time assertions
Dan Saks 6/17/2005 4:44 PM EDTFor some time now, I've been discussing how to use structures in C and C++ to define the layout of memory-mapped device registers. In my last column ("Sizing and Aligning Device Registers," May 2005, p.9), I presented techniqu转载 2011-03-16 19:53:00 · 787 阅读 · 0 评论 -
Sizing and aligning device registers
Dan Saks 4/7/2005 3:45 PM EDTModeling memory-mapped device registers is easy in concept but can be tricky in practice.<br />In my last three columns, I discussed variations on a basic technique for accessing memory-mapped device registers using C and C++.1转载 2011-03-16 19:52:00 · 727 阅读 · 0 评论 -
Introduction to fixed-width integers
Michael Barr 1/8/2004 1:00 PM ESTFor embedded programmers the most important improvement to C in the C99 standards is the new stdint.h header file.Computer programmers don't always care how wide an integer is when held by the processor. For example, when w转载 2011-03-16 19:44:00 · 909 阅读 · 0 评论 -
Place volatile accurately
Dan Saks 11/16/2005 3:26 PM ESTA volatile object is one whose value might change spontaneously. That is, when you declare an object to be volatile, you're telling the compiler that the object might change state even though no statements in the program appe转载 2011-03-15 16:03:00 · 933 阅读 · 0 评论 -
Tag vs. Type Names
Dan Saks 10/1/2002 9:46 AM EDTTag vs. Type NamesC treats tags as second class types. C++ isn't much kinder. Here's how to give them first-class treatment in both languages.Identifiers are among the most basic elements of programming languages. Languages us转载 2011-03-17 19:10:00 · 714 阅读 · 0 评论