自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(153)
  • 资源 (1)
  • 收藏
  • 关注

原创 “memory“ clobber

The "memory" clobber tells the compiler that the assembly code performs memory reads or writes to items other than those listed in the input and output operands. GCC may need to flush specific register values to memory before executing the asm to ensure th

2023-09-06 14:32:18 106

原创 uio write()

用户空间和内核空间对irq寄存器的读改写操作容易引起race condition,比如用户空间读改写来使能中断,此时外设产生一个中断,内核空间ISR需要禁掉中断。

2023-08-28 08:44:56 125

原创 STR(x)

【代码】STR(x)

2023-07-04 16:55:40 141

原创 sizeof(multi-dim)

int* (*a)[3][6];printf("%d"sizeof(a));->sizeof(pointer)printf("%d"sizeof(*a));->18 x sizeof(int *)printf("%d"sizeof(**a));->6 x sizeof(int *)printf("%d"sizeof(***a));->1 x sizeof(int *)printf("%d"sizeof(****a));->sizeof(int)

2022-04-23 12:00:34 227

原创 sizeof(struct abc)

struct abc {char a;char b;int c;};1_a1_b2_pad4_csizeof(abc) = 8---------------------------------------struct abcd {char a;char b;int c;char d;};1_a1_b2_pad4_c1_d3_padsizeof(abcd) = 12

2022-04-23 11:10:48 365

转载 eval ‘exec /usr/bin/perl -wS $0 ${1+“$@“}‘

这几行程序包含了太多的技巧。的确需要很深的功力才能看得懂。首先解释一下,# 打头的行在 shell 中表示该行是注释行,但是如果该脚本具有可执行权限,而直接执行(如 C 的 exec* 系列系统调用,或者 shell 下直接敲脚本名称)的时候,该行起到指示解释器的作用。在本例中,指定解释器是 /usr/bin/perl(假设用户的系统上已经安装了 Perl 并且安装位置就在 /usr/bin/perl 否则该脚本无论如何都是无法执行的)当一个用户拿到脚本时,根据个人习惯和知识水平的不同,可能会有

2020-11-05 10:32:55 260

转载 Is bar an rvalue or an lvalue?

I posted this answer: https://stackoverflow.com/a/28459180/2642059 Which contains the following code:void foo(string&& bar){ string* temp = &bar; cout << *temp <&l...

2020-03-08 11:38:14 142

原创 lval/rval and lval ref/rval ref

an lvalue expression refers to an object’s identityan rvalue expression refers to an object’s valueRval Ref: be bound to a conversion, to literals, or to expressions that return an rvalueRval Re...

2020-02-20 10:06:04 457

原创 pcie transactions

Egress(outbound) Ingress(inbound) as Root as endpoint as Root...

2020-02-10 17:40:41 189

转载 clause45 VS cluause22

http://www.ieee802.org/3/efm/public/nov02/oam/pannell_oam_1_1102.pdf

2020-01-09 15:19:27 679

转载 再议MII、RMII、GMII接口

(二)再议MII、RMII、GMII接口概述: MII (Media Independent Interface(介质无关接口)或称为媒体独立接口,它是IEEE-802.3定义的以太网行业标准。它包括一个数据接口和一个MAC和PHY之间的管理接口。 数据接口包括分别用于发送器和接收器的两条独立信道,每条信道都有自己的数据、时钟和控制信号。MII数据接口总共需要16个...

2020-01-09 14:54:14 428

转载 mii/mdio

(一)MII/MDIO接口详解  本文主要分析MII/RMII/SMII,以及GMII/RGMII/SGMII接口的信号定义,及相关知识,同时本文也对RJ-45接口进行了总结,分析了在10/100模式下和1000M模式下的设计方法。  MII接口提供了MAC与PHY之间、PHY与STA(Station Management)之间的互联技术,该接口支持10Mb/s与100Mb/s的数据传输速...

2020-01-09 14:35:22 419

原创 同步异步通信

不管是异步通信还是同步通信都需要进行同步,1) 异步通信通过传送字符内的起始位来进行同步,2) 同步通信采用共用外部时钟来进行同步。异步通信是自同步,同步通信是外同步。...

2020-01-09 13:31:23 221

转载 spi bus

SPI是串行外设接口(SerialPeripheral Interface)的缩写。是一种同步串行接口技术,是高速的,全双工,同步的通信总线。1、SPI接口的优点支持全双工操作;操作简单;数据传输速率较高。同时,它也具有如下缺点:需要占用主机较多的口线(每个从机都需要一根片选线);只支持单个主机;没有指定的流控制,没有应答机制确认是否接收到数据。...

2020-01-09 13:20:17 858

原创 i2c for at24cxx

CLOCK and DATA TRANSITIONS: The SDA pin is normally pulled high with an external device. Data on the SDApin may change only during SCL low time periods (refer to “Data Validity” diagram). Data ch...

2020-01-09 10:00:45 143

原创 num of ones in int

int numofones(int iVar, int *iCnt){*iCnt = 0;while (iVar) { *iCnt += 1; iVar = iVar & (iVar-1);}return 0;/success to get num of 1s/}

2019-12-26 10:19:08 101

原创 dead loop when using unsigned char

for (unsigned char ucIdx = 0; ucIdx < iMax; ++ucIdx) {malloc mem;}

2019-12-25 12:25:00 78

原创 bublle sort

/*from small to big*/int bubble_sort(int arry[], int size){ int outidx = 0; int inidx = 0; for (outidx = 0; outidx < size; ++outidx) { for (inidx = outidx + 1; inidx < siz...

2019-12-17 13:12:25 123

原创 运算符优先级

一扔三四点成员来挑选,数索函调类型造后面加加减减类型id明显转前面加加减减逻辑反,单加单减增与删,取址解引大与小,位反才能类型转乘除加减左右移大于小于等不等比特与比特异或比特或逻辑与逻辑或条件 ?:赋值扔异常逗号来帮忙...

2019-12-04 17:51:32 147

转载 A question about python deepcopy and shallow copy.

A question about python deepcopy and shallow copy.the post at What is the difference between a deep copy and a shallow copy?cannot help me.why e.g. 1 's sum is 6 not 10 ?e.g.1 :kvps = { '1'...

2019-12-04 14:18:27 838

原创 vim insert uinicode symbol

set encoding=utf-8insert or command mode(not normal mode),press Ctrl+v , then u, then unicode valctrl+v u 2018 -> ‘utf-8 encoding:8216 U+2018 E2 80 98 ‘ Left Single Quotation M...

2019-11-19 16:01:16 90

原创 functions

////////////////////////////////////////////Calls to functions that return references are lvalues; other return types yield rvalues.////////////////////////////////////////////The IO classes are...

2019-11-13 10:55:46 92

原创 class

/////////////////////////////////////////////// by default, the type of this is a const pointer to the nonconst version of the class typeT * const A const following the parameter li...

2019-11-13 10:22:50 78

原创 statements

///////////////////////////////////////////do statementwhile (condition);////////////////////////////////////////////////////

2019-11-13 10:00:21 135

转载 copy initialization and direct initialization

string s5("hiya");// direct initializationstring s6 = ("hiya");// copy initializationstring s7 = "hiya";// copyinitializationstring s8(10, 'c'); // direct initialization; s8 is ccccccccccstr...

2019-11-01 11:13:30 131

翻译 FAERIE QVEENE 仙后节选

FAERIE QVEENE《仙后》Canto 第2卷第4章第33-37节33Betwixt them both, they haue me doen to dye, 他们母子二人想置我于死地,Through wounds, & strokes,& stubborne handeling, 无所不用其极,一直敲打击踢,That death...

2019-10-30 20:27:45 865

转载 获取c++ auto/decltype生成的类型

Here's a trick, so you can make the compiler to print a type:template <typename>struct TD;Then use:TD<decltype(myWidget1)>();As TD<...> is an incomplete type, the compiler...

2019-10-30 17:49:22 123

转载 Regular Expression

根据这坛里的链接找到的台湾出品的几篇好贴,感觉很不错,又受到了一次基础培训和巩固复习.所以收藏后也共享给大家,谢谢!引用:Regular Expression 简介中央研究院计算中心ASPAC 计划[email protected]技术报告: 940191995 年 2 月 9 日Version : 1.0版权声明 目录 Why Regular Expression 组成 Regula

2017-05-04 11:05:12 558

转载 backslash preceding characters

In regular, unquoted situations, every character with a backslash preceding it has it's backslash processed, whether it needs it or not.But inside quotes or a heredoc, only the few listed characte

2017-04-05 13:22:26 424

转载 VT / Console / Xterm escape sequence

12345678910111213141516^V-Key Console (80x25) Xterm (KDE) Xterm/Nxterm (Gnome)------ Disp Binary Disp Binary Disp BinaryHome ^[[1~ 1B 5B 31 7E ^[[H 1B 5B 48 ^[OH 1B 4F 48End ^[[4~ 1B 5B 34 7E ^[[F 1B

2017-04-05 09:51:50 903

转载 LC_COLLATE is a variable which determines the collation order

There's a code snippet in ABS guide.#!/bin/bash# uppercase.sh : Changes input to uppercase.tr 'a-z' 'A-Z'# Letter ranges must be quoted#+ to prevent filename generation from single-letter file

2017-03-11 10:07:09 312

转载 What is the difference between Terminal, Console, Shell, and Command Line?

The short answer is thatterminal = text input/output environmentconsole = physical terminalshell = command line interpreterConsole and terminal are closely related. Originally, they meant a pi

2017-03-09 10:30:26 455

转载 about abs guide

////////////////////////////////////////////////////////////////I tried to remove all newlines in a pipe like this:(echo foo; echo bar) | sed -e :a -e N -e '$!ba' -e 's/\n/ /g' | hexdump -C

2017-03-08 16:33:54 347

原创 What is a 'Resource Intensive Program'?

What is a 'Resource Intensive Program'?The two most important resources required by programs (that are open on your computer) are the total memory (RAM) available and the processor speed.Resource ...

2017-02-23 13:01:08 415

转载 -W -Wall

-W is now deprecated by -Wextra with new gcc versions.From gcc man page: -Wextra This enables some extra warning flags that are not enabled by -Wall. (This option used to be called

2016-07-07 13:06:31 323

转载 about modern operating system lecture

3.5.3 Page sizePage size must be a multiple of the disk block size. Why?Answer: When copying out a page if you have a partial disk block, you must do a read/modify/write (i.e., 2 I/Os).Character

2016-05-27 15:31:10 723

转载 DBCS

DBCS故名思义就是用两个byte表示一个字符,是对各种采用两个byte表示一个字符(好像哪里重复了)的内码方案的一个统称。首先要明确的是先有各种双字节编码方案后有DBCS这个(概括性的)名字,DBCS并没有统一的规范,不存在通行的标准。只是早年使用DBCS的各国为了达到类似的目的,最后搞出来的方案大都类似而已。前提:早年的ASCII只定义了128个字符(可打印的96个),剩下最高

2016-03-10 22:05:51 854

转载 "railroad diagram"

1 down vote acceptedAs a "railroad diagram", this has some properties in common with a railroad track.Upon entering the diagram from the left, when arriving at the first switch, there is

2016-02-25 16:12:36 856

转载 Linux and the Device Tree

Linux and the Device Tree-------------------------The Linux usage model for device tree dataAuthor: Grant Likely This article describes how Linux uses the device tree. An overview ofthe device tree da

2015-12-04 16:23:39 474

转载 理解 Memory barrier(内存屏障)

跳到内容Name5566分享我的所学所感我的开源项目关于作者理解 Memory barrier(内存屏障)发布于 2014 年 04 月 21 日2014 年 05 月 15 日 作者 name5566参考文献列表:http://en.wikipedia.org/wiki/Memory_barrierhtt

2015-12-01 16:43:09 37019

嵌入式C/C++语言精华文章集锦

嵌入式开发中点滴深入钻研,希望能够帮助你在日常的面试和工作中有所帮助

2011-05-23

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除