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> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define BILLION 1000000000L; | |
int main( int argc, char **argv ) | |
{ | |
struct timespec start, stop; |
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
int SDN_MPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) | |
{ | |
int rank, size, sock, ret; | |
MPI_Comm_rank(comm, &rank); | |
MPI_Comm_size(comm, &size); | |
if (rank == 0) { | |
sock = connect_controller(); | |
install_allreduce_rules(sock, size, 1); |
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
上浮操作实现 | |
问题描述 | |
读入一个字符串。按照数组下标顺序依次将字符串中的字符插入到堆结构中(初始堆结构为空)。每在堆结构中插入一个元素,按数组下标顺序输出堆结构中的元素。 | |
直至建立一个包含输入字符串中所有字符元素的堆结构。 | |
输入格式 | |
字符串 (长度不超过1000个字符) | |
输出格式 | |
依次按照数组下标顺序输出堆结构内容 | |
样例输入 | |
THANKYOU |
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
interconnection networks -- packet switching networks | |
low-latency interconnection (as opposed to traditional packet switching networks) |
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
UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"myid"]; | |
[self.navigationController pushViewController:controller animated:YES]; |
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
x86 | |
From Wikipedia, the free encyclopedia | |
(Redirected from IF (x86 flag)) | |
IF (Interrupt Flag) is a system flag bit in the x86 architecture's FLAGS register, which determines whether or not the CPU will handle maskable hardware interrupts.[1] | |
The bit, which is bit 9 of the FLAGS register, may be set or cleared by programs with sufficient privileges, as usually determined by the Operating System. If the flag is set to 1, maskable hardware interrupts will be handled. If cleared (set to 0), such interrupts will be ignored. IF does not affect the handling of non-maskable interrupts or software interrupts generated by the INT instruction. | |
x86 FLAGS寄存器的第9位是IF(Interrupt flag) | |
置1响应中断 | |
置0忽略中断 | |
IF不会影响non-maskable中断和软中断(INT)的响应 |
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
// __do_exit - cause a thread exit (use do_exit, do_exit_thread instead) | |
// 1. call exit_mmap & put_pgdir & mm_destroy to free the almost all memory space of process | |
// 2. set process' state as PROC_ZOMBIE, then call wakeup_proc(parent) to ask parent reclaim itself. | |
// 3. call scheduler to switch to other process | |
static int __do_exit(void) | |
{ | |
if (current == idleproc) { | |
panic("idleproc exit.\n"); | |
} | |
if (current == initproc) { |
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
execution of an SVC instruction at a priority equal or higher than SVCall | |
svc指令在一个大于等于svcall的优先级下执行 | |
The original NuttX implementation used this PRIMASK register to enable and disable exceptions. Things now get interesting in the sequence of logic listed above because the PRIMASK bit also disables the SVCALL exception! So, instead of taking the SVCALL exception vector, the Cortex-M3/4 generates a hardfault exception (see ARM.com's discussion of Activation Levels. These hardfaults are not really a problem; the design of the NuttX hardfault handler expects these exceptions and does the right thing. However, the occurrence of hardfaults may come as a surprise to many people – and especially to some debuggers. | |
使用PRIMASK寄存器进行开关中断 | |
PRIMASK位也会禁止SVCALL异常 | |
所以在PRIMASK为1时,Cortex-M3会产生HardFault异常,而不是执行SVCALL异常处理。 | |
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
//mmuless的情形下,就是把制定的文件中的内容拷贝到内存中来。 | |
unsigned long do_mmap(struct file * file, unsigned long addr, unsigned long len, | |
unsigned long prot, unsigned long flags, unsigned long off) | |
{ | |
void * result; | |
struct mm_tblock_struct * tblock; | |
/* An ENOSYS error indicates that mmap isn't possible (as opposed to | |
tried but failed) so we'll fall through to the copy. */ | |
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
.a archive “存档”格式: | |
一组被连接起来的可重定位目标文件的集合 | |
使用gnu ar工具进行创建和修改 | |
静态库文件(.a): | |
在链接时,链接器将只拷贝被应用程序引用的目标模块 | |
《深入理解计算机系统》例题学习: | |
gcc -c addvec.c multvec.c | |
ar res libvector.a addvec.o multvec.o | |
gcc -O2 -c main.c |
NewerOlder