资源简介
ZYNQ LINUX+BAREMETAL

代码片段和文件信息
/*
* devmem2.c: Simple program to read/write from/to any location in memory.
*
* Copyright (C) 2000 Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl)
*
*
* This software has been developed for the LART computing board
* (http://www.lart.tudelft.nl/). The development has been sponsored by
* the Mobile MultiMedia Communications (http://www.mmc.tudelft.nl/)
* and Ubiquitous Communications (http://www.ubicom.tudelft.nl/)
* projects.
*
* The author can be reached at:
*
* Jan-Derk Bakker
* Information and Communication Theory Group
* Faculty of Information Technology and Systems
* Delft University of Technology
* P.O. Box 5031
* 2600 GA Delft
* The Netherlands
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not write to the Free Software
* Foundation Inc. 59 Temple Place Suite 330 Boston MA 02111-1307 USA
*
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define FATAL do { fprintf(stderr “Error at line %d file %s (%d) [%s]\n“ \
__LINE__ __FILE__ errno strerror(errno)); exit(1); } while(0)
#define MAP_SIZE 4096UL
#define MAP_MASK (MAP_SIZE - 1)
int main(int argc char **argv) {
int fd;
void *map_base *virt_addr;
unsigned long read_result writeval;
off_t target;
int access_type = ‘w‘;
if(argc < 2) {
fprintf(stderr “\nUsage:\t%s { address } [ type [ data ] ]\n“
“\taddress : memory address to act upon\n“
“\ttype : access operation type : [b]yte [h]alfword [w]ord\n“
“\tdata : data to be written\n\n“
argv[0]);
exit(1);
}
target = strtoul(argv[1] 0 0);
if(argc > 2)
access_type = tolower(argv[2][0]);
if((fd = open(“/dev/mem“ O_RDWR | O_SYNC)) == -1) FATAL;
printf(“/dev/mem opened.\n“);
fflush(stdout);
/* Map one page */
map_base = mmap(0 MAP_SIZE PROT_READ | PROT_WRITE MAP_SHARED fd target & ~MAP_MASK);
if(map_base == (void *) -1) FATAL;
printf(“Memory mapped at address %p.\n“ map_base);
fflush(stdout);
virt_addr = map_base + (target & MAP_MASK);
switch(access_type) {
case ‘b‘:
read_result = *((unsigned char *) virt_addr);
break;
case ‘h‘:
read_resu
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-12-16 09:35 Zynq-AMP-XLNX-master\
文件 378 2015-12-16 09:35 Zynq-AMP-XLNX-master\.gitattributes
文件 574 2015-12-16 09:35 Zynq-AMP-XLNX-master\.gitignore
目录 0 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\
目录 0 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\FPGA\
文件 2083850 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\FPGA\system.bit
目录 0 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\dtb\
文件 12058 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\dtb\devicetree.dtb
文件 4598 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\dtb\pl.dtsi
文件 297 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\dtb\skeleton.dtsi
文件 1755 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\dtb\system.dts
文件 10183 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\dtb\zynq-7000.dtsi
目录 0 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\elfs\
文件 419538 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\elfs\amp_fsbl.elf
文件 188720 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\elfs\app_cpu1.elf
文件 1892814 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\elfs\u-boot.elf
目录 0 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\kernel\
文件 3486352 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\kernel\uImage
目录 0 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\u-boot\
文件 1892814 2015-12-16 09:35 Zynq-AMP-XLNX-master\generated_files\u-boot\u-boot.elf
目录 0 2015-12-16 09:35 Zynq-AMP-XLNX-master\hardware_prj\
文件 535 2015-12-16 09:35 Zynq-AMP-XLNX-master\hardware_prj\hw.xdc
文件 39116 2015-12-16 09:35 Zynq-AMP-XLNX-master\hardware_prj\ps.tcl
文件 8774 2015-12-16 09:35 Zynq-AMP-XLNX-master\hardware_prj\system.tcl
文件 930 2015-12-16 09:35 Zynq-AMP-XLNX-master\hardware_prj\system_pro.tcl
文件 2633 2015-12-16 09:35 Zynq-AMP-XLNX-master\hardware_prj\system_wrapper.v
文件 3902 2015-12-16 09:35 Zynq-AMP-XLNX-master\readme.md
目录 0 2015-12-16 09:35 Zynq-AMP-XLNX-master\sd_boot\
文件 2538124 2015-12-16 09:35 Zynq-AMP-XLNX-master\sd_boot\BOOT.bin
文件 12058 2015-12-16 09:35 Zynq-AMP-XLNX-master\sd_boot\devicetree.dtb
目录 0 2015-12-16 09:35 Zynq-AMP-XLNX-master\sd_boot\devmem\
............此处省略414个文件信息
- 上一篇:组合最优化算法和复杂性
- 下一篇:黎曼几何初步
相关资源
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- Reparatory Effects of Nicotine on NMDA Recepto
- Apolipoprotein E4 Impairs in vivo Hippocampal
- 联想W520/T520笔记本电脑电路原理图
- DSP28335程序片内FLASH搬运至RAM运行的
- Bochs入门教程[操作系统第一步]
- SAMPLE (类pascal) 词法分析程序 C 版
- 细菌cyclic di-AMP的信号调控
- In vitro screening of lactobacilli with antago
- 鉴于DAMPE e + e-过剩,II型跷跷板模型在
- pdf.jsamp;pdf;.worker.js
- 自适应滤波amp;LMS算法
- VirtualTreeview 最新版支持 XE10.3
- WinCC V7.4 SP1:入门指南
- 嵌入式实时操作系统μC/OS-II与eCos的
- 基于STM32的嵌入式双目图像采集系统设
- 嵌入式实时操作系统μC/OS-II在ARM上的
- 嵌入式操作系统的解析
- ServiceStack V3.9 全部dll
- 华为公司人力资源管理纲要2.0总纲公
- AzkabanAPI接口文档汇总
- 音频测试文件pcmmp3aacamrg711ag711u等多种
- 3GPP TS 38.104 V16.0.0.pdf--5G基站无线发送
- Exact Conditions of Blow-up and Global Existen
- 广义g-函数在广义Campanato空间上的有界
- Type-c 接口封装,24引脚,Altium Design
- PIC单片机人机接口模块4×4行列式
- PIC单片机人机接口模块4×4行列式
- netty-高并发编程-视频教程张龙-90讲完
- A Pathfinding Project Pro v4.2.2.rar
评论
共有 条评论