<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>press is the best backup for your word</title>
	<atom:link href="http://surekang.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://surekang.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 16 Oct 2007 13:08:28 +0000</lastBuildDate>
	<language></language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='surekang.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>press is the best backup for your word</title>
		<link>http://surekang.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://surekang.wordpress.com/osd.xml" title="press is the best backup for your word" />
	<atom:link rel='hub' href='http://surekang.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Memory Initialization in boot time of E500</title>
		<link>http://surekang.wordpress.com/2007/10/16/memory-initialization-in-boot-time-of-e500/</link>
		<comments>http://surekang.wordpress.com/2007/10/16/memory-initialization-in-boot-time-of-e500/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 13:08:28 +0000</pubDate>
		<dc:creator>surekang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://surekang.wordpress.com/2007/10/16/memory-initialization-in-boot-time-of-e500/</guid>
		<description><![CDATA[The first stage, the physical memoruy info is collected, we setup the bitmap for all the memory in boot time. MMU_init[arch/ppc/kernel/head_fsl_booke.S:358] is called in stext. Here set_phys_avail is called to get physical memory info ./*  * Set phys_avail to the amount of physical memory, * less the kernel text/data/bss.*/in setup_arch, do_init_bootmem used to initialize the bootmem bitmap min_low_pfn = start &#62;&#62; PAGE_SHIFT; max_low_pfn = (PPC_MEMSTART + total_lowmem) &#62;&#62; PAGE_SHIFT; max_pfn = (PPC_MEMSTART + total_memory) &#62;&#62; PAGE_SHIFT; boot_mapsize = init_bootmem_node(&#38;contig_page_data, min_low_pfn, PPC_MEMSTART &#62;&#62; PAGE_SHIFT, max_low_pfn);According to phys_avail struct, the memory is freed in bootmem bitmap. /* add everything in phys_avail into [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=58&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><P>The first stage, the physical memoruy info is collected, we setup the bitmap for all the memory in boot time. </P><P>MMU_init[arch/ppc/kernel/head_fsl_booke.S:358] is called in stext. Here set_phys_avail is called to get physical memory info .</P><P>/* </P><P> * Set phys_avail to the amount of physical memory,<BR> * less the kernel text/data/bss.<BR>*/<BR><BR><BR>in setup_arch, do_init_bootmem used to initialize the bootmem bitmap </P><P>min_low_pfn = start &gt;&gt; PAGE_SHIFT;<BR><BR>        max_low_pfn = (PPC_MEMSTART + total_lowmem) &gt;&gt; PAGE_SHIFT;<BR><BR>        max_pfn = (PPC_MEMSTART + total_memory) &gt;&gt; PAGE_SHIFT;<BR><BR>        boot_mapsize = init_bootmem_node(&amp;contig_page_data, min_low_pfn,<BR><BR>                                         PPC_MEMSTART &gt;&gt; PAGE_SHIFT,<BR><BR>                                         max_low_pfn);<BR><BR>According to phys_avail struct, the memory is freed in bootmem bitmap.</P><P>        /* add everything in phys_avail into the bootmem map */<BR><BR>        for (i = 0; i &lt; phys_avail.n_regions; ++i)<BR><BR>                free_bootmem(phys_avail.regions[i].address,<BR><BR>                             phys_avail.regions[i].size);<BR><BR>The second stage , we initizlize all the zones and all the page struct according to the amount of available memory, initialize the memmap (a global variable that used to point to all the page.)<BR>Still in setup_arch, paging_init is called</P><P>free_area_init-&gt;free_area_init_node-&gt;free_area_init_core-&gt;init_currently_empty_zone-&gt;memmap_init-&gt;memmap_init_zone</P><P>in memmap_init_zone, all the pages is initialized and is set to reserved. </P><P>The third stage:  in mem_init</P><P>mem_init-&gt;free_all_bootmem-&gt;free_all_bootmem_core </P><P>free_all_bootmem_core: used to free the pages according to bootmem allocator , then bootmem allocator itself is also freed.</P><P>map = bdata-&gt;node_bootmem_map;<BR><BR>        /* Check physaddr is O(LOG2(BITS_PER_LONG)) page aligned */<BR><BR>        if (bdata-&gt;node_boot_start == 0 ||<BR><BR>            ffs(bdata-&gt;node_boot_start) &#8211; PAGE_SHIFT &gt; ffs(BITS_PER_LONG))<BR><BR>                gofast = 1;<BR><BR>        for (i = 0; i &lt; idx; ) {<BR><BR>                unsigned long v = ~map[i / BITS_PER_LONG];<BR><BR><BR><BR>                if (gofast &amp;&amp; v == ~0UL) {<BR><BR>                        int order;<BR><BR><BR><BR>                        page = pfn_to_page(pfn);<BR><BR>                        count += BITS_PER_LONG;<BR><BR>                        order = ffs(BITS_PER_LONG) &#8211; 1;<BR><BR>                        __free_pages_bootmem(page, order);<BR><BR>                        i += BITS_PER_LONG;<BR><BR>                        page += BITS_PER_LONG;<BR><BR>                } else if (v) {<BR><BR>                        unsigned long m;<BR><BR><BR><BR>                        page = pfn_to_page(pfn);<BR><BR>                        for (m = 1; m &amp;&amp; i &lt; idx; m&lt;&lt;=1, page++, i++) {<BR><BR>                                if (v &amp; m) {<BR><BR>                                        count++;<BR><BR>                                        __free_pages_bootmem(page, 0);<BR><BR>                                }<BR><BR>                        }<BR><BR>                } else {<BR><BR>                        i += BITS_PER_LONG;<BR><BR>                }<BR><BR>                pfn += BITS_PER_LONG;<BR><BR>        }<BR> </P></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/surekang.wordpress.com/58/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/surekang.wordpress.com/58/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/surekang.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/surekang.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/surekang.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/surekang.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/surekang.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/surekang.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/surekang.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/surekang.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/surekang.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/surekang.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/surekang.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/surekang.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/surekang.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/surekang.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=58&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://surekang.wordpress.com/2007/10/16/memory-initialization-in-boot-time-of-e500/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f838a80f5bd4bcea62dc538b437a21c7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">surekang</media:title>
		</media:content>
	</item>
		<item>
		<title>Kaffe porting: two workaround for compile</title>
		<link>http://surekang.wordpress.com/2006/04/14/kaffe-porting-two-workaround-for-compile/</link>
		<comments>http://surekang.wordpress.com/2006/04/14/kaffe-porting-two-workaround-for-compile/#comments</comments>
		<pubDate>Fri, 14 Apr 2006 03:46:45 +0000</pubDate>
		<dc:creator>surekang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://surekang.wordpress.com/2006/04/14/kaffe-porting-two-workaround-for-compile/</guid>
		<description><![CDATA[In the head of kaffe/kaffevm/debug.h , add #undef TRANSLATOR #undef ENABLE_BINRELOC to disable binreloc function and jit vm.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=40&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the head of kaffe/kaffevm/debug.h , add<br />
#undef TRANSLATOR<br />
#undef ENABLE_BINRELOC<br />
to disable binreloc function and jit vm.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/surekang.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/surekang.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/surekang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/surekang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/surekang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/surekang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/surekang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/surekang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/surekang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/surekang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/surekang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/surekang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/surekang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/surekang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/surekang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/surekang.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=40&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://surekang.wordpress.com/2006/04/14/kaffe-porting-two-workaround-for-compile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f838a80f5bd4bcea62dc538b437a21c7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">surekang</media:title>
		</media:content>
	</item>
		<item>
		<title>Something I should remember</title>
		<link>http://surekang.wordpress.com/2006/04/14/something-i-should-remember/</link>
		<comments>http://surekang.wordpress.com/2006/04/14/something-i-should-remember/#comments</comments>
		<pubDate>Fri, 14 Apr 2006 03:44:05 +0000</pubDate>
		<dc:creator>surekang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://surekang.wordpress.com/2006/04/14/something-i-should-remember/</guid>
		<description><![CDATA[oprofile presentation 嘉宝力的项目 aubery timer question<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=53&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>oprofile presentation<br />
嘉宝力的项目<br />
aubery timer question</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/surekang.wordpress.com/53/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/surekang.wordpress.com/53/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/surekang.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/surekang.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/surekang.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/surekang.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/surekang.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/surekang.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/surekang.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/surekang.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/surekang.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/surekang.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/surekang.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/surekang.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/surekang.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/surekang.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=53&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://surekang.wordpress.com/2006/04/14/something-i-should-remember/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f838a80f5bd4bcea62dc538b437a21c7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">surekang</media:title>
		</media:content>
	</item>
		<item>
		<title>blackfin uclinux training</title>
		<link>http://surekang.wordpress.com/2006/04/12/blackfin-uclinux-training/</link>
		<comments>http://surekang.wordpress.com/2006/04/12/blackfin-uclinux-training/#comments</comments>
		<pubDate>Wed, 12 Apr 2006 02:04:12 +0000</pubDate>
		<dc:creator>surekang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://surekang.wordpress.com/2006/04/12/blackfin-uclinux-training/</guid>
		<description><![CDATA[http://www.sysdcs.com/SDCSucbf.html http://www.bestpractical.com/rt/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=52&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://www.sysdcs.com/SDCSucbf.html
</p>
<p>http://www.bestpractical.com/rt/</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/surekang.wordpress.com/52/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/surekang.wordpress.com/52/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/surekang.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/surekang.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/surekang.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/surekang.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/surekang.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/surekang.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/surekang.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/surekang.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/surekang.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/surekang.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/surekang.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/surekang.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/surekang.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/surekang.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=52&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://surekang.wordpress.com/2006/04/12/blackfin-uclinux-training/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f838a80f5bd4bcea62dc538b437a21c7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">surekang</media:title>
		</media:content>
	</item>
		<item>
		<title>Memory Management in uClinux</title>
		<link>http://surekang.wordpress.com/2006/03/15/memory-management-in-uclinux/</link>
		<comments>http://surekang.wordpress.com/2006/03/15/memory-management-in-uclinux/#comments</comments>
		<pubDate>Wed, 15 Mar 2006 11:26:00 +0000</pubDate>
		<dc:creator>surekang</dc:creator>
				<category><![CDATA[uClinux]]></category>

		<guid isPermaLink="false">https://surekang.wordpress.com/2006/03/15/memory-management-in-uclinux/</guid>
		<description><![CDATA[( come from caidaolinux in linuxforum) 对于内存管理，uclinux有两套策略，在uClinux-dist\linux-2.4.x\mmnommu的目录下的Makefile文件就可以看出： ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC obj-y += page_alloc2.o else obj-y += page_alloc.o endif 如果没有定义CONFIG_CONTIGUOUS_PAGE_ALLOC，那么内存的管理是比较简单，所有的内存都是通过通用缓冲区来分配的，但 是内存管理的效率不高，浪费严重，对于内存非常少得系统来说，这样的策略是不可以接受的。当然设定 CONFIG_CONTIGUOUS_PAGE_ALLOC选项就可以使用连续分配页面的方法（不是伙伴算法，是一种简单的算法），但在uclinux中 是实验性的，我想也许还需要进一步的测试吧。我们可以从kmalloc的代码中看出些许端倪 void * kmalloc (size_t size, int flags) { cache_sizes_t *csizep = cache_sizes; #ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC if (size &#62;= PAGE_SIZE) { unsigned long addr; addr = __get_contiguous_pages(flags, (size+PAGE_SIZE-1)/PAGE_SIZE, 0); return (void *)addr; } #endif for (; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=51&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>( come from <a href="http://www.linuxforum.net/forum/showprofile.php?Cat=&amp;User=caidaolinux&amp;Number=452639&amp;Board=linuxK&amp;what=showflat&amp;page=5&amp;view=collapsed&amp;sb=5&amp;o=all&amp;fpart=1&amp;vc=1"> caidaolinux</a> in linuxforum)</p>
<p>对于内存管理，uclinux有两套策略，在uClinux-dist\linux-2.4.x\mmnommu的目录下的Makefile文件就可以看出：<br />
ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC<br />
obj-y    += page_alloc2.o<br />
else<br />
obj-y    += page_alloc.o<br />
endif<br />
如果没有定义CONFIG_CONTIGUOUS_PAGE_ALLOC，那么内存的管理是比较简单，所有的内存都是通过通用缓冲区来分配的，但 是内存管理的效率不高，浪费严重，对于内存非常少得系统来说，这样的策略是不可以接受的。当然设定 CONFIG_CONTIGUOUS_PAGE_ALLOC选项就可以使用连续分配页面的方法（不是伙伴算法，是一种简单的算法），但在uclinux中 是实验性的，我想也许还需要进一步的测试吧。我们可以从kmalloc的代码中看出些许端倪<br />
void * kmalloc (size_t size, int flags)<br />
{<br />
cache_sizes_t *csizep = cache_sizes;</p>
<p>#ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC<br />
if (size &gt;= PAGE_SIZE) {<br />
unsigned long addr;<br />
addr = __get_contiguous_pages(flags, (size+PAGE_SIZE-1)/PAGE_SIZE, 0);<br />
return (void *)addr;<br />
}<br />
#endif</p>
<p>for (; csizep-&gt;cs_size; csizep++) {<br />
if (size &gt; csizep-&gt;cs_size)<br />
continue;<br />
return __kmem_cache_alloc(flags &amp; GFP_DMA ?<br />
csizep-&gt;cs_dmacachep : csizep-&gt;cs_cachep, flags);<br />
}<br />
return NULL;<br />
}</p>
<p>没有定义CONFIG_CONTIGUOUS_PAGE_ALLOC的时候，所有的内存分配都是来自通用缓冲区，包括加载程序的时候，比如一个大 小为1.2M的程序，分配的内存会高达2M，其实即便加上bss段和stack段也需要不了那么多的内存，但是因为通用缓冲区的内存都是2的幂的级数，所 以1M下面就是2M的slab，而多余的空间被进程用来作堆，也就是进程中调用的malloc分配的内存就来自这些所谓的多余的空间。</p>
<p>对定义了CONFIG_CONTIGUOUS_PAGE_ALLOC的情况，同是通过一些全局的数据来控制内存的分配<br />
static char *bit_map = NULL;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;整个内存使用情况的位图<br />
static int	 bit_map_size = 0;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;位图的大小<br />
static int	 first_usable_page = 0;&#8212;&#8212;&#8212;&#8212;-第一个可用的页面<br />
static int   _nr_free_pages = 0;  &#8212;&#8212;&#8212;&#8212;&#8212;-总共空闲的页面的大小</p>
<p>具体的策略很简单，看看 __get_contiguous_pages和free_contiguous_pages即可 </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/surekang.wordpress.com/51/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/surekang.wordpress.com/51/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/surekang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/surekang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/surekang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/surekang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/surekang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/surekang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/surekang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/surekang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/surekang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/surekang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/surekang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/surekang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/surekang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/surekang.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=51&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://surekang.wordpress.com/2006/03/15/memory-management-in-uclinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f838a80f5bd4bcea62dc538b437a21c7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">surekang</media:title>
		</media:content>
	</item>
		<item>
		<title>How to select between spinlock and semaphore?</title>
		<link>http://surekang.wordpress.com/2006/03/15/how-to-select-between-spinlock-and-semaphore/</link>
		<comments>http://surekang.wordpress.com/2006/03/15/how-to-select-between-spinlock-and-semaphore/#comments</comments>
		<pubDate>Wed, 15 Mar 2006 11:20:33 +0000</pubDate>
		<dc:creator>surekang</dc:creator>
				<category><![CDATA[OSS Miscallenous]]></category>

		<guid isPermaLink="false">https://surekang.wordpress.com/2006/03/15/how-to-select-between-spinlock-and-semaphore/</guid>
		<description><![CDATA[(转载) &#62;&#62;需要澄清的是，互斥手段的选择，不是根据临界区的大小，而是根据临界区的性质，以及 &#62;&#62;有哪些部分的代码，即哪些内核执行路径来争夺。 我觉得不完全正确,互斥手段的选择, 应该是根据临界区的大小, 临界区的性质以及竞争临界区的执行路径的数量这三个因数来同时决定. 首先, 如果竞争临界区的执行路径中存在interrupt handler的话, 那么只能选用spinlock且本地关中断的方法. 其次, 因为semaphore会导致进程上下文切换, 因此如果临界区也就一两百条指令, 也即属于短期互斥, 且竞争临界区的执行路径数量不多, 那么选用spinlock反而会比用semaphore的性能要好. 因为上下文切换本身就是一个很大的开销, 另外, 上下文切换后会使得cpu cache出险大量的cache miss. 从而使系统吞吐量下降.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=50&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>(转载)<br />
<font color="red">&gt;&gt;需要澄清的是，互斥手段的选择，不是根据临界区的大小，而是根据临界区的性质，以及<br />
&gt;&gt;有哪些部分的代码，即哪些内核执行路径来争夺。</font></p>
<p>我觉得不完全正确,互斥手段的选择, 应该是根据临界区的大小, 临界区的性质以及竞争临界区的执行路径的数量这三个因数来同时决定.</p>
<p>首先, 如果竞争临界区的执行路径中存在interrupt handler的话, 那么只能选用spinlock且本地关中断的方法.</p>
<p>其次, 因为semaphore会导致进程上下文切换, 因此如果临界区也就一两百条指令, 也即属于短期互斥, 且竞争临界区的执行路径数量不多, 那么选用spinlock反而会比用semaphore的性能要好. 因为上下文切换本身就是一个很大的开销, 另外, 上下文切换后会使得cpu cache出险大量的cache miss. 从而使系统吞吐量下降.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/surekang.wordpress.com/50/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/surekang.wordpress.com/50/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/surekang.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/surekang.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/surekang.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/surekang.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/surekang.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/surekang.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/surekang.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/surekang.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/surekang.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/surekang.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/surekang.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/surekang.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/surekang.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/surekang.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=50&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://surekang.wordpress.com/2006/03/15/how-to-select-between-spinlock-and-semaphore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f838a80f5bd4bcea62dc538b437a21c7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">surekang</media:title>
		</media:content>
	</item>
		<item>
		<title>what is footprint?</title>
		<link>http://surekang.wordpress.com/2006/03/15/what-is-footprint/</link>
		<comments>http://surekang.wordpress.com/2006/03/15/what-is-footprint/#comments</comments>
		<pubDate>Wed, 15 Mar 2006 11:12:12 +0000</pubDate>
		<dc:creator>surekang</dc:creator>
				<category><![CDATA[OSS Miscallenous]]></category>

		<guid isPermaLink="false">https://surekang.wordpress.com/2006/03/15/what-is-footprint/</guid>
		<description><![CDATA[(转载) 足印(footprint)是指要完成某个工作，需要访问的缓存(一般指L1 DATA CACHE 或TLB)项的个数。 例如，完成的工作是：访问B. 但要访问B对象首先必须从A对象中获得B的指针，如果A,B在一个页面中，那么只需要在TLB踏上一个&#8221;足印&#8221;就可以了， 否则需要踏上两个“足印”；进一步的，如果A,B对象在同一个16或者32个字节对齐的空间里，那么在L1 DATA CACHE里只需要踏上一个足印就可以了。 一般完成某项工作在各种缓存上的足印越少，引起缓存失去命中的可能性就越小，缓存和内存之间的交互就越小，因此访问速度就越快。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=49&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font color="#0066cc">(</font>转载<font color="#0066cc">)<br />
足印(footprint)是指要完成某个工作，需要访问的缓存(一般指L1              DATA CACHE 或TLB)项的个数。<br />
例如，完成的工作是：访问B. 但要访问B对象首先必须从A对象中获得B的指针，如果A,B在一个页面中，那么只需要在TLB踏上一个&#8221;足印&#8221;就可以了，<br />
否则需要踏上两个“足印”；进一步的，如果A,B对象在同一个16或者32个字节对齐的空间里，那么在L1              DATA CACHE里只需要踏上一个足印就可以了。<br />
一般完成某项工作在各种缓存上的足印越少，引起缓存失去命中的可能性就越小，缓存和内存之间的交互就越小，因此访问速度就越快。</font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/surekang.wordpress.com/49/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/surekang.wordpress.com/49/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/surekang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/surekang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/surekang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/surekang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/surekang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/surekang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/surekang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/surekang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/surekang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/surekang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/surekang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/surekang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/surekang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/surekang.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=49&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://surekang.wordpress.com/2006/03/15/what-is-footprint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f838a80f5bd4bcea62dc538b437a21c7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">surekang</media:title>
		</media:content>
	</item>
		<item>
		<title>difference of register allocation algorithm between translation and compilation</title>
		<link>http://surekang.wordpress.com/2006/03/08/difference-of-register-allocation-algorithm-between-translation-and-compilation/</link>
		<comments>http://surekang.wordpress.com/2006/03/08/difference-of-register-allocation-algorithm-between-translation-and-compilation/#comments</comments>
		<pubDate>Wed, 08 Mar 2006 04:57:03 +0000</pubDate>
		<dc:creator>surekang</dc:creator>
				<category><![CDATA[SkyEye]]></category>

		<guid isPermaLink="false">http://surekang.wordpress.com/2006/03/08/difference-of-register-allocation-algorithm-between-translation-and-compilation/</guid>
		<description><![CDATA[There is much different on register allocation algorithm between translation and compilation. In general speaking, compilation allow to take more time do register allocation sine all the action is done in compilation time. However, translation happens in runtime, it will take less time to do it comparing to compilation . In translation , time cost [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=44&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There is much different on register allocation algorithm between translation and compilation. In general speaking, compilation allow to take more time do register allocation sine all the action is done in compilation time. However, translation happens in runtime, it will take less time to do it comparing to compilation . In translation , time cost and code optimazation have the same importance.  So classic graphics rendering algorithm in compilation  is not suitable in translation. For translation, there often only does one pass optimation for cost as less time as soon. But if , some hot-spot of a program can be detected in long-time run.So for these hotspot. maybe we can take more pass to optimization these hot-sopt to improve the speed.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/surekang.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/surekang.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/surekang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/surekang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/surekang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/surekang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/surekang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/surekang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/surekang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/surekang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/surekang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/surekang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/surekang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/surekang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/surekang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/surekang.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=44&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://surekang.wordpress.com/2006/03/08/difference-of-register-allocation-algorithm-between-translation-and-compilation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f838a80f5bd4bcea62dc538b437a21c7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">surekang</media:title>
		</media:content>
	</item>
		<item>
		<title>Why not uClinux can not use fork?</title>
		<link>http://surekang.wordpress.com/2006/02/22/why-not-uclinux-can-not-use-fork/</link>
		<comments>http://surekang.wordpress.com/2006/02/22/why-not-uclinux-can-not-use-fork/#comments</comments>
		<pubDate>Wed, 22 Feb 2006 03:03:50 +0000</pubDate>
		<dc:creator>surekang</dc:creator>
				<category><![CDATA[uClinux]]></category>

		<guid isPermaLink="false">http://surekang.wordpress.com/2006/02/22/why-not-uclinux-can-not-use-fork/</guid>
		<description><![CDATA[Wirte-On-Copy is used in fork system call of linux, Thus the process is created more efficiently by fork(). In the fork, the memory required by task struct is just allocated some page and physical memory is not allocated at this time. When memory of new process is need to write , the memory fault is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=36&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Wirte-On-Copy is used in fork system call of linux, Thus the process is created more efficiently by fork(). In the fork, the memory required by task struct is just allocated some page and physical memory is not allocated at this time. When memory of new process is need to write , the memory fault is encountered.The map between the page and physical memory is setup.  We can call this kind of implementation Write-On-Copy . But in NON-MMU system, for uClinux, such design can not implemented at all since we have no page , no page framework and other required things&#8230;&#8230;So we have to use vfork to replace the fork in uClinux</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/surekang.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/surekang.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/surekang.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/surekang.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/surekang.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/surekang.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/surekang.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/surekang.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/surekang.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/surekang.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/surekang.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/surekang.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/surekang.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/surekang.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/surekang.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/surekang.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=36&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://surekang.wordpress.com/2006/02/22/why-not-uclinux-can-not-use-fork/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f838a80f5bd4bcea62dc538b437a21c7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">surekang</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;access misaligned address violation&#8221;</title>
		<link>http://surekang.wordpress.com/2006/02/15/access-misaligned-address-violation/</link>
		<comments>http://surekang.wordpress.com/2006/02/15/access-misaligned-address-violation/#comments</comments>
		<pubDate>Wed, 15 Feb 2006 08:06:34 +0000</pubDate>
		<dc:creator>surekang</dc:creator>
				<category><![CDATA[uClinux]]></category>

		<guid isPermaLink="false">http://surekang.wordpress.com/2006/02/15/access-misaligned-address-violation/</guid>
		<description><![CDATA[The error is caused by the following statement: [net/irda/irlmp.c:854] u16ho(irlmp-&#62;discovery_cmd.data.hints) = irlmp-&#62;hints.word; irlmp-&#62;discovery_cmd.data.hints is defined as an arrry of u8 hints[2]. The above statement tries to transform this array of u8 to a data of u16 by u16ho macro. But irlmp-&#62;discovery_cmd.data.hints is located in 0&#215;207053. Its address is not aligned 16-bit boundary.So misalgned address violation [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=34&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The error is caused by the following statement: [net/irda/irlmp.c:854]<br />
u16ho(irlmp-&gt;discovery_cmd.data.hints) = irlmp-&gt;hints.word;<br />
irlmp-&gt;discovery_cmd.data.hints is defined as an arrry of u8 hints[2]. The above statement tries to transform this array of u8 to a data of u16 by u16ho macro. But irlmp-&gt;discovery_cmd.data.hints is located in 0&#215;207053. Its address  is not aligned 16-bit boundary.So misalgned address violation is occured . Maybe a bug of linux? For if architecture do not  support non-aligned access and compiler will not aligned the non-aligned access automatically, this issue will be encountered.So I think that is the responsibility of programmer who should always deal with non-align access.Maybe they should organize his data to fit the data boundary. But if the program must be written in such way,some space is wasted for fullfill the requirement of alilgnment.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/surekang.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/surekang.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/surekang.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/surekang.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/surekang.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/surekang.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/surekang.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/surekang.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/surekang.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/surekang.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/surekang.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/surekang.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/surekang.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/surekang.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/surekang.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/surekang.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=surekang.wordpress.com&amp;blog=77769&amp;post=34&amp;subd=surekang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://surekang.wordpress.com/2006/02/15/access-misaligned-address-violation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f838a80f5bd4bcea62dc538b437a21c7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">surekang</media:title>
		</media:content>
	</item>
	</channel>
</rss>
