- 博客(20)
- 资源 (22)
- 收藏
- 关注
原创 Studying note of GCC-3.4.6 source (7)
1.2.4. Create node for address conceptIn C++, concept of pointer, reference, and address are exchangable at certain level. The langauage allows to manipulate the content of the address directly via
2010-02-26 11:52:00 768
原创 GCC-3.4.6源代码学习笔记(7)
1.2.4. 与地址相关节点的构造在C++中,指针、引用和地址在一定程度上可以混用。语言允许通过指针或者引用直接改变地址所在的内容。而函数调用,事实上是通过跳转到相应的地址来实现。另外在语言中,数组名也代表数组的首地址。因此,编译器可能需要首先创建与地址相关的节点,再由这个节点出发构建其它节点。比如,构建函数或数组节点。1.2.4.1. 指针类型节点的构造1.2.4.1.1.
2010-02-26 11:48:00 1340
原创 Modultils工具源码分析之insmod篇 (4续)
xftw在./modutils-2.4.0/util/xftw.c中。在ftw.c文件的开头有一大段注释,解释了这一族函数的由来。特摘录如下。Insmod——xftw函数24 /*25 modutils requires special processing during the file tree walk26 of /lib/modules
2010-02-25 13:39:00 1148
原创 Modultils工具源码分析之insmod篇 (4)
至此,do_read的工作就完成了,接着config_read也结束。继续看INSMOD_MAIN。 1565 if (persist_name && !*persist_name &&1566 (!persistdir || !*persistdir)) {1567 free(pe
2010-02-25 13:16:00 868
原创 Studying note of GCC-3.4.6 source (6)
1.2.3. Create node for real constantNode in GCC to represent real constant is tree_real_cst as below.1.2.3.1. Node of tree_real_cst 702 struct tree_real_cst GTY(())
2010-02-25 11:58:00 1057
原创 GCC-3.4.6源代码学习笔记(6)
1.2.3. 创建浮点常量节点在GCC中表示浮点常量的节点是下面所示的tree_real_cst。1.2.3.1. tree_real_cst节点 702 struct tree_real_cst GTY(()) in
2010-02-25 11:47:00 1466
原创 Studying note of GCC-3.4.6 source (5)
1.2.2. Create node for internal types For internal types of the language, for example, int, unsigned short in C/C++, the compiler will create nodes for these types first when it starts up.1.2.2.1.
2010-02-24 12:11:00 995
原创 GCC-3.4.6源代码学习笔记(5)
1.2.2. 内建类型的树节点对于语言中的内建类型,例如,C/C++中的int,unsigned short等,编译器在启动时便会为这些类型创建节点。1.2.2.1. 初始化临时的size_t节点在创建内建类型的节点前,先要创建临时的size_t节点(一个用作size_t,另一个用作bitsize_t。size_t是sizeof的返回类型,bitsize_t由前端
2010-02-24 11:40:00 1854
原创 Modultils工具源码分析之insmod篇 (3续)
我们继续看meta_expand余下的代码。251~255行处理“"/”这样的元符号,其实就是字符串引用符号。257~260行则是处理普通字符及仅有“=”的情况。函数split_line也在同一文件中。Insmod——split_line函数47 /*48 * Split into words delimited by whitespace,49 * handl
2010-02-23 12:05:00 903 1
原创 Modultils工具源码分析之insmod篇 (3)
在./modutils-2.4.0/depmod/目录下有一个配置文件的样式,Example.module.conf。 1 # This is an example of additional definitions you can put in /etc/modules.conf2 # Note that modprobe has some default alias
2010-02-23 11:58:00 1152
原创 Studying note of GCC-3.4.6 source (4)
1.2. Building tree nodesAbove make_node gives the tool to create nodes for certain tree code. However, this facility is quite primitive. GCC also defines a series functions to create nodes group for
2010-02-23 11:44:00 909
原创 GCC-3.4.6源代码学习笔记(4)
1.2. 树节点的构造上面make_node提供了构造树节点的方法,但它比较初级,节点由0填充。为了更好地为表达式,语句等语法成分构造树节点,GCC定义了一系列函数。我们先看一部分。1.2.2. 机器模式的概念[2]机器模式描述了一个数据对象的大小和它的表示方式。在GCC中,机器模式由定义在machmode.def文件中的枚举类型enum machine_mode来表示(准确地说,ma
2010-02-23 11:40:00 2571
原创 Modultils工具源码分析之insmod篇 (2)
insmod的入口在insmod.c,在./modultils-2.4.0/insmod/下。 1944 /* For common 3264 code, only compile main in the 64 bit version. */1945 #if defined(COMMON_3264) && defined(ONLY_32)1946
2010-02-22 13:25:00 3217
原创 Modultils工具源码分析之insmod篇 (1)
这系列是几年前发的。现在回过头看,还是蛮有意思的。把它们一起放上来。 Modultils工具源码分析之insmod篇 作者:吴晖2005年12月29日前言Linux的前身UNIX是一个巨内核操作系统,这样的系统运行效率高,但是内核占据的资源比较多,而且更要命的是系统在启动时必须把所有的设备驱动都加载,不管有没有用。另外,每添加或修改驱动都要重新编
2010-02-22 12:53:00 3458
原创 Studying note of GCC-3.4.6 source (3)
1.1.3. Tree node allocation1.1.3.1. Decision of node sizeThe allocaiton function of tree node is done by make_node below. The detail of parameter code is shown in above tables, note that it is
2010-02-22 11:46:00 1084
原创 GCC-3.4.6源代码学习笔记(3)
1.1.3. 树节点的内存分配1.1.3.1. 节点大小的确定树节点由下面的make_node函数来分配。函数中的参数code,在上面的表中给出,注意它也是由.def文件定义的。 202 tree203 make_node (enum tree_code code)
2010-02-22 11:40:00 1719
原创 Studying note of GCC-3.4.6 source (2)
1.1.1. Identifier of tree node - tree_code Within the definition of tree_node, items like tree_type, tree_decl etc, are used for the semantics ingrediences, for example, tree_type is used for type d
2010-02-21 15:10:00 1509
原创 Studying note of GCC-3.4.6 source (1)
About 4 years ago, I joined GDNT – the coventure of Nortel in China and worked in project of Radio access network of 3G UMTS; where I used GCC first time. At that time Nortel widely used GCC as the of
2010-02-21 15:06:00 1941
原创 GCC-3.4.6源代码学习笔记(2)
1.1.1. tree_code —— 树节点的ID在tree_node的定义中,结构体,象tree_type,tree_decl 等,用于代表相应的语法成分。比如,tree_type用于类的定义,而type_decl用于声明。但如果需要进一步分别,比如tree_decl节点为何种声明,则我们需要用到在tree_node中的另一个位。这就是在tree_common定义中,第134行的code。
2010-02-21 14:49:00 3588
原创 GCC-3.4.6源代码学习笔记(1)
大约4年前,我加入了GDNT - 北电网络在中国的合资企业,参与3G UMTS无线接入网的研发工作。与GCC有了第一次亲密的接触(之前使用的是MS的VC)。彼时,北电在其诸如,UMTS、CDMA、及自行开发的众多工具等项目中(此后,在4G项目,Wimax及Lte中),将GCC作为标准编译器来使用。每周我都需要进行数次的loadbuild,编译出load文件进行测试,以验证我对一些bug的修正代码。
2010-02-21 14:43:00 8059 15
Introduction to Theory of Computation
2018-09-23
Survey on Instruction Selection
2018-09-23
Towards a Compilation infrastructure for network processors
2018-09-23
Crafting a Compiler
2018-09-01
How Debuggers Work
2018-09-01
Compiler Construction-20th
2018-09-01
Compiler Construction-19th
2018-09-01
Compiler Construction-17th
2018-09-01
Compiler Construction-16th
2018-09-01
Compiler Construction-5th
2018-09-01
Construction and Evolution of Code Generator
2018-09-01
Compiler Construction-11th
2018-09-01
The compiler design handbook
2018-09-01
Data_Flow_Analysis_Theory_And_Practice(Bookos.org)
2018-09-01
The Compiler Design Handbook Optimizations and machine code generation
2018-09-01
instruction scheduling for instruction level parallel processor
2018-07-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人