This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONFIG_MODULE_SIG = n | |
TARGET_MODULE := test_mutex | |
obj-m := $(TARGET_MODULE).o | |
ccflags-y := -std=gnu99 -Wno-declaration-after-statement | |
KDIR := /lib/modules/$(shell uname -r)/build | |
PWD := $(shell pwd) | |
all: client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PWD := $(shell pwd) | |
KDIR = /usr/src/linux-headers-$(shell uname -r)/ | |
MODULE_NAME = floating | |
obj-m := $(MODULE_NAME).o | |
ccflags-y := -std=gnu99 -Wno-declaration-after-statement -mhard-float | |
all: clean integer_ver float_ver | |
gnuplot plot.gp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reference: https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Function-Attributes.html | |
#include <stdio.h> | |
extern void func(void); | |
void print_hi(void) { | |
printf("hello~\n"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = gcc | |
SIZE = 100000 | |
all: macro function | |
macro: base.c | |
$(CC) -o macro base.c -DMACRO -g -DNAME=\"macro.log\" | |
function: base.c | |
$(CC) -o function base.c -g -DNAME=\"func.log\" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void wrong_change(int number) { | |
int num; | |
num = number; | |
num++; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
void wrong_change(int); | |
void correct_change(int*); | |
int main() { | |
int number = 5; | |
printf("the number now is : %d\n",number); |