linuxÄں˿ռäÉêÇ볬¹ý2MBÁ¬Ðø¿Õ¼äµÄʵÏÖº¯Êý¡£
/*
kmalloc can apply 128KB memory only. This func support any continous memory allocate more than 2MB.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kallsyms.h>
#define KMEM_PAGES //apply more than one page
#define KMEM_DEBUG //debug message switch
/*
// Pure 2^n version of get_order
static __inline__ __attribute_const__ int get_order(unsigned long size)
{
int order;
size = (size - 1) >> (PAGE_SHIFT - 1);
order = -1;
do {
size >>= 1;
order++;
} while (size);
return order;
}
*/
/*
alloc memory for DMA using in kernel space.
*/
void *kmem_alloc(size_t size, dma_addr_t *dma_handle, unsigned long flags)
{
struct page *page; //start page address
void *cpu_addr = NULL; //cpu io address
struct page *end; //end of pages
unsigned int PageOrder=0;
size = PAGE_ALIGN(size); //must be times of 4KB
PageOrder=get_order(size);
#ifdef CONFIG_ISOLATE_HIGHMEM //allocate in high memory
page = alloc_pages(GFP_HIGHUSER, PageOrder);
#else //allocate from low memory
page = alloc_pages(GFP_KERNEL, PageOrder); //get_order(size) means how many 4KB page do you want to apply. 2^n
#end
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
×÷Õߣº·ëÀÚ (flw10000) MAIL£ºflw10000 AT 163.com
¾¹ý½üÒ»ÖܵÄæºõ£¬°Ñ»ùÓÚlinuxµÄMIPS½»²æ±àÒë»·¾³»ù±¾´î½¨³É¹¦£¬ÕâÀï˵"»ù±¾"´î½¨³É¹¦ÊÇÒòΪ»·¾³ËäÈ»´î½¨ºÃÁË£¬¿ÉÒÔ±àÒë»ùÓڣͣɣУӵĿÉÖ´ÐÐÎļþÁË£¬µ«»¹Ã»ÓÐÔÚÕæÕýµÄ£Í£É£Ð£Ó»·¾³Ï²âÊÔ¹ý£¬»¹ÓÐÔÚ±àÒëµÄ¹ý³ÌÖгöÏÖÁËЩÎÊÌ⣬ËäÈ»½â¾öÁË£¬Ò²ÒòûÓÐÔÚÕæÕýµÄ£Í£É£ ......
LinuxµÄÒ»¸öÎüÒýÈ˵ÄÌØÐÔ¾ÍÊÇÓû§¿ÉÒÔ×ÔÐж¨ÖÆÕû¸öϵͳ£¬Äã¿ÉÊÇÔËÐÐÒ»¸öÖ»ÓÐ1MµÄ“ÃÔÄã”Linux£¬Ò²¿ÉÒÔÔËÐÐÒ»¸ö¼¸GµÄÇ¿´óLinux¡£¶øÎÞÂÛÄãÔËÐÐÔõÑùµÄLinux£¬Äã¶¼ÊÇÏÈ´ÓÒýµ¼³ÌÐò¿ªÊ¼ÔËÐеġ£¶ÔÓÚÆÕͨÓû§£¬´ó¶à¶¼ÊÇÔÚ¸öÈ˵çÄÔÉÏÔËÐÐLinuxµÄ¡£
¡¡¡¡¸öÈ˵çÄÔ£¬ÓÖ½ÐPC»ú£¬ÊÇÎÒÃdz£¼ûµÄʹÓÃIntel»òAMDµÄоƬµÄµç ......
¡¡¡¡ÄãÏë³ÉÖªµÀÈçºÎ³ÉΪһ¸öLinuxÄں˿ª·¢Õßô£¿»òÕßÄãµÄÀÏ°å¸æËßÄ㣬“ȥΪÕâ¸öÉ豸дһ¸öLinuxÇý¶¯¡£“ÕâÆªÎĵµµÄÄ¿µÄ£¬¾ÍÊÇͨ¹ýÃèÊöÄãÐèÒª¾ÀúµÄ¹ý³ÌºÍÌáʾÄãÈçºÎºÍÉçÇøÒ»Æð¹¤×÷£¬À´½Ì¸øÄãΪ´ïµ½ÕâЩĿµÄËùÐèÒªÖªµÀµÄËùÓÐ֪ʶ¡£±¾ÎÄÒ²³¢ÊÔ½âÊÍÉçÇøÎªÊ²Ã´ÕâÑù¹¤×÷µÄһЩÔÒò¡£
¡¡¡¡Äں˼¸ºõÈ«ÊÇÓÃCд³ÉµÄ£¬ÓÐ ......
Ò»¡¢ÒªÇó£º
1¡¢Äܹ»ÏÔʾ³öMakefileµÄ×ÜÊý
2¡¢ÄÜÏÔʾһ¼¶Ä¿Â¼ÏµÄMakefile×ÜÊý¡¢MakefileÁÐ±í¼°ÆäMakefileµÄÄÚÈÝ
3¡¢Äܽ«ÉÏÊöÄÚÈÝдÈëÏàÓ¦µÄÎļþ
¶þ¡¢ÊµÀý
rm -rf ~/Desktop/linux_Makefile/*
for i in `find . -maxdepth 1 -type d`
#½ö½öÊǵ±Ç°Ä¿Â¼£¬ËùÒÔÇ뽫±¾½Å±¾·ÅÔÚlinuxÔ´ÂëĿ¼ÏÂÖ´ÐС£
do
e ......