From f1ead126008e8e73fac05c193450d3aac57fc4e1 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 20 Nov 2012 10:43:05 -0600 Subject: [PATCH] Minor cleanup --- fpga/xilinx/programmer/svfplayer/xsvf-rpi.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/fpga/xilinx/programmer/svfplayer/xsvf-rpi.c b/fpga/xilinx/programmer/svfplayer/xsvf-rpi.c index 45d8c78..034abbc 100644 --- a/fpga/xilinx/programmer/svfplayer/xsvf-rpi.c +++ b/fpga/xilinx/programmer/svfplayer/xsvf-rpi.c @@ -1,14 +1,14 @@ /* * Lib(X)SVF - A library for implementing SVF and XSVF JTAG players * - * Copyright (C) 2012 Timothy Pearson + * Copyright (C) 2012 Timothy Pearson (Raspberry Pi) * Copyright (C) 2009 RIEGL Research ForschungsGmbH * Copyright (C) 2009 Clifford Wolf - * + * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR @@ -72,22 +72,22 @@ static void io_setup(void) printf("can't open /dev/mem \n"); exit (-1); } - + /* mmap GPIO */ - + // Allocate MAP block if ((gpio_mem = malloc(BLOCK_SIZE + (PAGE_SIZE-1))) == NULL) { printf("allocation error \n"); exit (-1); } - + // Make sure pointer is on 4K boundary if ((unsigned long)gpio_mem % PAGE_SIZE) { gpio_mem += PAGE_SIZE - ((unsigned long)gpio_mem % PAGE_SIZE); } - + // Now map it - gpio_map = (unsigned char *)mmap( + gpio_map = (char *)mmap( (caddr_t)gpio_mem, BLOCK_SIZE, PROT_READ|PROT_WRITE, @@ -95,12 +95,12 @@ static void io_setup(void) mem_fd, GPIO_BASE ); - + if ((long)gpio_map < 0) { printf("mmap error %d\n", (int)gpio_map); exit (-1); } - + // Always use volatile pointer! gpio = (volatile unsigned *)gpio_map; @@ -372,6 +372,7 @@ static void copyleft() fprintf(stderr, "xsvftool-gpio, part of Lib(X)SVF (http://www.clifford.at/libxsvf/).\n"); fprintf(stderr, "Copyright (C) 2009 RIEGL Research ForschungsGmbH\n"); fprintf(stderr, "Copyright (C) 2009 Clifford Wolf \n"); + fprintf(stderr, "Copyright (C) 2012 Timothy Pearson (Raspberry Pi)\n"); fprintf(stderr, "Lib(X)SVF is free software licensed under the ISC license.\n"); already_printed = 1; }