Commit bad00b56 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

cleanup of the sw

parent 696d7eff
CC=/acc/sys/L865/cdk/gcc -m32
CXX=/acc/sys/L865/cdk/g++ -m32
CFLAGS = -I. -g
CXXFLAGS = -I. -g
OBJS = wrn-lib.o fmc-lib.o list-lib.o
all: lib list-boot list-input-test test-rx test-hash list-output-test list-dbg
lib: $(OBJS)
ar rc libwrn.a $(OBJS)
list-boot: list-boot.o $(OBJS)
${CXX} -o list-boot list-boot.o $(OBJS) -L. -lwrn -lpthread
list-dbg: list-dbg.o $(OBJS)
${CXX} -o list-dbg list-dbg.o $(OBJS) -L. -lwrn -lpthread
test-rx: test-rx.o $(OBJS)
${CXX} -o test-rx test-rx.o $(OBJS) -L. -lwrn -lpthread
test-hash: test-hash.o $(OBJS)
${CXX} -o test-hash test-hash.o $(OBJS) -L. -lwrn -lpthread
list-input-test: list-input-test.o $(OBJS)
${CXX} -o list-input-test list-input-test.o $(OBJS) -L. -lwrn -lpthread
list-output-test: list-output-test.o $(OBJS)
${CXX} -o list-output-test list-output-test.o $(OBJS) -L. -lwrn -lpthread
clean:
rm -f $(OBJS) libwrn.a test-rx test-hash list-boot
%.o: %.cpp
${CXX} -o $@ -c $^ $(CXXFLAGS)
\ No newline at end of file
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2012 GSI (www.gsi.de)
* Author: Wesley W. Terpstra <w.terpstra@gsi.de>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#include <string.h>
#include <stdio.h>
#include "fmc-lib.h"
#define SDB_INTERCONNET 0x00
#define SDB_DEVICE 0x01
#define SDB_BRIDGE 0x02
#define SDB_EMPTY 0xFF
typedef struct pair64 {
uint32_t high;
uint32_t low;
} pair64_t;
struct sdb_empty {
int8_t reserved[63];
uint8_t record_type;
};
struct sdb_product {
pair64_t vendor_id;
uint32_t device_id;
uint32_t version;
uint32_t date;
int8_t name[19];
uint8_t record_type;
};
struct sdb_component {
pair64_t addr_first;
pair64_t addr_last;
struct sdb_product product;
};
struct sdb_device {
uint16_t abi_class;
uint8_t abi_ver_major;
uint8_t abi_ver_minor;
uint32_t bus_specific;
struct sdb_component sdb_component;
};
struct sdb_bridge {
pair64_t sdb_child;
struct sdb_component sdb_component;
};
struct sdb_interconnect {
uint32_t sdb_magic;
uint16_t sdb_records;
uint8_t sdb_version;
uint8_t sdb_bus_type;
struct sdb_component sdb_component;
};
typedef union sdb_record {
struct sdb_empty empty;
struct sdb_device device;
struct sdb_bridge bridge;
struct sdb_interconnect interconnect;
} sdb_record_t;
static unsigned int sdb_find_device(struct fmc_dev *dev, unsigned int base, unsigned int vendor, unsigned int devid)
{
sdb_record_t *record =
int records = record->interconnect.sdb_records;
int i;
for(i = 0; i < sizeof(struct sdb_record) / 4; i++)
{
}
for (i = 0; i < records; ++i, ++record) {
if (record->empty.record_type == SDB_BRIDGE) {
unsigned char *out =
find_device_deep(dev, base +
record->bridge.sdb_component.
addr_first.low,
base +
record->bridge.sdb_child.low,
devid);
if (out)
return out;
}
if (record->empty.record_type == SDB_DEVICE &&
record->device.sdb_component.product.device_id == devid &&
record->device.sdb_component.product.vendor_id.low == vendor) {
break;
}
}
if (i == records)
return 0;
return (unsigned char *)(base +
record->device.sdb_component.addr_first.low);
}
static void print_devices_deep(unsigned int base, unsigned int sdb)
{
sdb_record_t *record = (sdb_record_t *) sdb;
int records = record->interconnect.sdb_records;
int i;
char buf[20];
for (i = 0; i < records; ++i, ++record) {
if (record->empty.record_type == SDB_BRIDGE)
print_devices_deep(base +
record->bridge.sdb_component.
addr_first.low,
base +
record->bridge.sdb_child.low);
if (record->empty.record_type != SDB_DEVICE)
continue;
memcpy(buf, record->device.sdb_component.product.name, 19);
buf[19] = 0;
mprintf("%8x:%8x 0x%8x %s\n",
record->device.sdb_component.product.vendor_id.low,
record->device.sdb_component.product.device_id,
base + record->device.sdb_component.addr_first.low,
buf);
}
}
void sdb_print_devices(void)
{
mprintf("SDB memory map:\n");
print_devices_deep(0, SDB_ADDRESS);
mprintf("---\n");
}
void sdb_find_devices(void)
{
BASE_MINIC = find_device(0xab28633a);
BASE_EP = find_device(0x650c2d4f);
BASE_SOFTPLL = find_device(0x65158dc0);
BASE_PPS_GEN = find_device(0xde0d8ced);
BASE_SYSCON = find_device(0xff07fc47);
BASE_UART = find_device(0xe2d13d04);
BASE_ONEWIRE = find_device(0x779c5443);
BASE_ETHERBONE_CFG = find_device(0x68202b22);
}
#include <stdarg.h>
/*
* minimal vsprintf: only %s and hex values
* Alessandro Rubini 2010, based on code in u-boot (from older Linux)
* GNU GPL version 2.
*/
int pp_vsprintf(char *buf, const char *fmt, va_list args)
{
int i, j;
static char hex[] = "0123456789abcdef";
char *s;
char *str = buf;
for (; *fmt ; ++fmt) {
if (*fmt != '%') {
*str++ = *fmt;
continue;
}
repeat:
fmt++; /* Skip '%' initially, other stuff later */
/* Skip the complete format string */
switch(*fmt) {
case '\0':
goto ret;
case '*':
/* should be precision, just eat it */
i = va_arg(args, int);
/* fall through: discard unknown stuff */
default:
goto repeat;
/* Special cases for conversions */
case 'c': /* char: supported */
*str++ = (unsigned char) va_arg(args, int);
break;
case 's': /* string: supported */
s = va_arg(args, char *);
while (*s)
*str++ = *s++;
break;
case 'n': /* number-thus-far: not supported */
break;
case '%': /* supported */
*str++ = '%';
break;
/* all integer (and pointer) are printed as <%08x> */
case 'o':
case 'x':
case 'X':
case 'd':
case 'i':
case 'u':
case 'p':
i = va_arg(args, int);
*str++ = '<';
for (j = 28; j >= 0; j -= 4)
*str++ = hex[(i>>j)&0xf];
*str++ = '>';
break;
}
}
ret:
*str = '\0';
return str - buf;
}
OUTPUT_FORMAT("elf32-lm32")
ENTRY(_start)
MEMORY
{
ram :
ORIGIN = 0x00000000,
LENGTH = 32768 - 2048
stack :
ORIGIN = 32768 - 2048,
LENGTH = 2048
}
SECTIONS
{
.boot : { *(.boot) } > ram
.text : { *(.text .text.*) } > ram =0
.rodata : { *(.rodata .rodata.*) } > ram
.data : {
*(.data .data.*)
_gp = ALIGN(16) + 0x7ff0;
} > ram
.bss : {
_fbss = .;
*(.bss .bss.*)
*(COMMON)
_ebss = .;
} > ram
PROVIDE(_endram = ORIGIN(stack));
PROVIDE(_fstack = ORIGIN(stack) + LENGTH(stack) - 4);
}
PROVIDE(mprintf = pp_printf);
#include "fmc-lib.h"
main(int argc, char *argv[])
{
struct fmc_dev *fmc = fmc_svec_create(0);
fmc->reprogram(fmc, argv[1]);
return 0;
}
#include <stdio.h>
#include <unistd.h>
#include "fmc-lib.h"
#include "wrn-lib.h"
//uint32_t sdb_traverse (struct fmc_dev *dev, uint32_t base, uint32_t sdb_addr, uint32_t vendor, uint32_t device);
void monitor_hmq()
{
}
main()
{
struct wrn_dev *node = wrn_open_by_lun(0);
wrn_cpu_load_file(node, 0, "rt/tdc/rt-tdc.bin");
wrn_cpu_start(node, (1<<0));
for(;;)
{
wrn_update_mqueues(node);
usleep(10000);
}
}
/*
* This work is part of the White Rabbit Node Core project.
*
* Copyright (C) 2013-2014 CERN (www.cern.ch)
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
/*.
* White Rabbit Node Core
*
* mqueue.h: MQ register definitions
*/
#ifndef __MQUEUE_H
#define __MQUEUE_H
#define BASE_HMQ 0x00000
// Global Control Regs
#define MQUEUE_GCR (0x0)
// Incoming slot base address
#define MQUEUE_IN(slot) (0x4000 + (slot) * 0x400)
// Outgoung slot base address
#define MQUEUE_OUT(slot) (0x8000 + (slot) * 0x400)
// MQ commands
#define MQUEUE_CMD_CLAIM (1<<24)
#define MQUEUE_CMD_PURGE (1<<25)
#define MQUEUE_CMD_READY (1<<26)
#define MQUEUE_CMD_DISCARD (1<<27)
// MQ slot register offsets
#define MQUEUE_SLOT_COMMAND 0
#define MQUEUE_SLOT_STATUS 4
#define MQUEUE_SLOT_DATA_START 8
// MQ GCR register offsets
#define MQUEUE_GCR_INCOMING_STATUS_MASK (0x0000ffff)
#define MQUEUE_GCR_SLOT_COUNT 0
#define MQUEUE_GCR_SLOT_STATUS 4
#define MQUEUE_GCR_IRQ_MASK 8
#define MQUEUE_GCR_IRQ_COALESCE 12
#define MQUEUE_SLOT_STATUS_FULL (1<<0)
#endif
/*
* This work is part of the White Rabbit Node Core project.
*
* Copyright (C) 2013-2014 CERN (www.cern.ch)
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
/*.
* White Rabbit Node Core
*
* rt-smem.h: Shared Memory definitions & API
*/
#ifndef __WRNODE_SMEM_H
#define __WRNODE_SMEM_H
#define SMEM_RANGE_ADD 0x2000
#define SMEM_RANGE_SUB 0x4000
#define SMEM_RANGE_SET 0x6000
#define SMEM_RANGE_CLEAR 0x8000
#define SMEM_RANGE_FLIP 0xa000
#define SMEM __attribute__((section(".smem")))
static inline void smem_atomic_add(int *p, int x)
{
*(volatile int *)(p + (SMEM_RANGE_ADD >> 2)) = x;
}
static inline void smem_atomic_sub(int *p, int x)
{
*(volatile int *)(p + (SMEM_RANGE_SUB >> 2)) = x;
}
#endif
......@@ -21,6 +21,7 @@
#include "rt-mqueue.h"
#include "rt-common.h"
#include "rt-smem.h"
#include "pp-printf.h"
......
CC=/acc/sys/L865/cdk/gcc -m32
CXX=/acc/sys/L865/cdk/g++ -m32
CFLAGS = -I. -g -I../include
CXXFLAGS = -I. -g -I../include
OBJS = wrn-lib.o fmc-lib.o list-lib.o
all: lib
lib: $(OBJS)
ar rc liblist.a $(OBJS)
clean:
rm -f $(OBJS) liblist.a
%.o: %.cpp
${CXX} -o $@ -c $^ $(CXXFLAGS)
\ No newline at end of file
......@@ -471,4 +471,4 @@ int list_out_get_state ( struct list_node *dev, int output, struct list_output_s
obuf[25] = st->width_cycles;
obuf[26] = st->worst_latency;*/
}
\ No newline at end of file
}
......@@ -4,7 +4,7 @@
#include <stdio.h>
#include <stdint.h>
#include "rt/common/list-common.h"
#include "list-common.h"
struct list_trigger_handle {
uint32_t ptr_cond;
......
#include "rt.h"
#include "list-common.h"
#define LOOP_QUEUE_SIZE 16
SMEM int head, tail, count;
SMEM struct list_trigger_entry buf[16];
......@@ -7,13 +7,13 @@ OBJDUMP = $(CROSS_COMPILE)objdump
OBJCOPY = $(CROSS_COMPILE)objcopy
SIZE = $(CROSS_COMPILE)size
CFLAGS = -DWRNODE_RT -g -O3 -I. -I../common -mmultiply-enabled -mbarrel-shift-enabled
OBJS += ../common/wrn-crt0.o ../common/vsprintf-xint.o ../common/printf.o ../common/rt-common.o
CFLAGS = -DWRNODE_RT -g -O3 -I. -I../common -I../../include -mmultiply-enabled -mbarrel-shift-enabled
OBJS += ../common/wrn-crt0.o ../common/vsprintf-xint.o ../common/printf.o ../common/rt-common.o ../common/loop-queue.o
LDSCRIPT = ../common/wrnode.ld
$(OUTPUT): $(LDSCRIPT) $(OBJS)
${CC} -o $(OUTPUT).elf -nostartfiles $(OBJS) -T $(LDSCRIPT) -lgcc -lc
${OBJCOPY} -O binary $(OUTPUT).elf $(OUTPUT).bin
${OBJCOPY} --remove-section .smem -O binary $(OUTPUT).elf $(OUTPUT).bin
${OBJDUMP} -S $(OUTPUT).elf > disasm.S
$(SIZE) $(OUTPUT).elf
......
OBJS = rt-fd.o hash.o
OUTPUT = rt-fd
include ../common/wrnode.mk
This diff is collapsed.
/*
* This work is part of the White Rabbit Node Core project.
*
* Copyright (C) 2013-2014 CERN (www.cern.ch)
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
/*.
* LHC Instability Trigger Distribution (LIST) Firmware.
*
* hash.c: Trigger Output hash table implementation
*/
#include <string.h>
#include "hash.h"
/* constant sized block memory pool, providing constant time allocation and freeing */
struct blockpool {
int blk_size;
int blk_count;
uint16_t *fq;
int fq_head, fq_tail, fq_count;
void *pool;
};
static uint32_t hash_pool_mem [ FD_HASH_ENTRIES * sizeof(struct lrt_hash_entry) / 4 ];
static uint16_t hash_pool_queue [ FD_HASH_ENTRIES +1 ];
static struct blockpool hash_blockpool;
struct lrt_hash_entry* htab [ FD_HASH_ENTRIES ];
void blockpool_init( struct blockpool *bp, int blk_size, int blk_count, void *data, void *queue )
{
int i;
bp->pool = data;
bp->fq = queue;
bp->blk_count = blk_count;
bp->blk_size = blk_size;
bp->fq_head = blk_count;
bp->fq_tail = 0;
bp->fq_count = blk_count;
for(i=0;i<bp->blk_count;i++)
bp->fq[i] = i;
}
void *blockpool_alloc( struct blockpool *bp )
{
if(bp->fq_head == bp->fq_tail)
{
return NULL;
}
void *blk = bp->pool + bp->blk_size * (int)bp->fq[bp->fq_tail];
if(bp->fq_tail == bp->blk_count)
bp->fq_tail = 0;
else
bp->fq_tail++;
bp->fq_count--;
return blk;
}
void blockpool_free( struct blockpool *bp, void *ptr )
{
int blk_id = (ptr - bp->pool) / bp->blk_size;
bp->fq[bp->fq_head] = blk_id;
if(bp->fq_head == bp->blk_count)
bp->fq_head = 0;
else
bp->fq_head++;
bp->fq_count++;
}
void hash_init()
{
blockpool_init(&hash_blockpool, sizeof(struct lrt_hash_entry), FD_HASH_ENTRIES, hash_pool_mem, hash_pool_queue);
memset(&htab, 0, sizeof(htab) );
}
struct lrt_hash_entry *hash_alloc( int pos )
{
struct lrt_hash_entry *prev = NULL, *current = htab[pos];
while(current)
{
prev = current;
current = current->next;
}
current = blockpool_alloc(&hash_blockpool);
if(!prev)
htab[pos] = current;
else
prev->next = current;
current->next = NULL;
return current;
}
struct lrt_hash_entry *hash_add ( struct list_id *id, int output, struct lrt_output_rule *rule )
{
int pos;
struct lrt_hash_entry *ent = hash_search( id, &pos );
if(!ent)
ent = hash_alloc( pos );
if(!ent)
return NULL;
ent->id = *id;
ent->ocfg[output] = *rule;
return ent;
}
int hash_remove ( struct lrt_hash_entry *ent, int output )
{
int pos, i;
ent->ocfg[output].state = HASH_ENT_EMPTY;
for(i = 0; i < FD_NUM_CHANNELS; i++)
if(ent->ocfg[i].state != HASH_ENT_EMPTY) // the same ID is assigned to another output
return 0;
if (ent == htab[pos])
htab[pos] = ent->next;
else {
struct lrt_hash_entry *tmp = htab[pos]->next;
htab[pos]->next = ent->next;
ent->next = tmp;
}
blockpool_free(&hash_blockpool, ent);
return 0;
}
struct lrt_hash_entry *hash_get_entry (int bucket, int pos)
{
int i;
if(bucket < 0 || bucket >= FD_HASH_ENTRIES)
return NULL;
struct lrt_hash_entry *l = htab[bucket];
for(i = 0; l != NULL && i < pos; i++, l=l->next)
if(!l)
return NULL;
return l;
}
int hash_free_count()
{
return hash_blockpool.fq_count;
}
/*
Register definitions for slave core: Fine Delay Channel WB Slave
* File : fd_channel_regs.h
* Author : auto-generated by wbgen2 from fd_channel_wishbone_slave.wb
* Created : Fri Feb 15 12:07:17 2013
* Standard : ANSI C
THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE fd_channel_wishbone_slave.wb
DO NOT HAND-EDIT UNLESS IT'S ABSOLUTELY NECESSARY!
*/
#ifndef __WBGEN2_REGDEFS_FD_CHANNEL_WISHBONE_SLAVE_WB
#define __WBGEN2_REGDEFS_FD_CHANNEL_WISHBONE_SLAVE_WB
#include <inttypes.h>
#if defined( __GNUC__)
#define PACKED __attribute__ ((packed))
#else
#error "Unsupported compiler?"
#endif
#ifndef __WBGEN2_MACROS_DEFINED__
#define __WBGEN2_MACROS_DEFINED__
#define WBGEN2_GEN_MASK(offset, size) (((1<<(size))-1) << (offset))
#define WBGEN2_GEN_WRITE(value, offset, size) (((value) & ((1<<(size))-1)) << (offset))
#define WBGEN2_GEN_READ(reg, offset, size) (((reg) >> (offset)) & ((1<<(size))-1))
#define WBGEN2_SIGN_EXTEND(value, bits) (((value) & (1<<bits) ? ~((1<<(bits))-1): 0 ) | (value))
#endif
/* definitions for register: Delay Control Register */
/* definitions for field: Enable channel in reg: Delay Control Register */
#define FD_DCR_ENABLE WBGEN2_GEN_MASK(0, 1)
/* definitions for field: Delay mode select in reg: Delay Control Register */
#define FD_DCR_MODE WBGEN2_GEN_MASK(1, 1)
/* definitions for field: Pulse generator arm in reg: Delay Control Register */
#define FD_DCR_PG_ARM WBGEN2_GEN_MASK(2, 1)
/* definitions for field: Pulse generator triggered in reg: Delay Control Register */
#define FD_DCR_PG_TRIG WBGEN2_GEN_MASK(3, 1)
/* definitions for field: Start Delay Update in reg: Delay Control Register */
#define FD_DCR_UPDATE WBGEN2_GEN_MASK(4, 1)
/* definitions for field: Delay Update Done in reg: Delay Control Register */
#define FD_DCR_UPD_DONE WBGEN2_GEN_MASK(5, 1)
/* definitions for field: Force Calibration Delay in reg: Delay Control Register */
#define FD_DCR_FORCE_DLY WBGEN2_GEN_MASK(6, 1)
/* definitions for field: Disable Fine Part update in reg: Delay Control Register */
#define FD_DCR_NO_FINE WBGEN2_GEN_MASK(7, 1)
/* definitions for field: Force Output High in reg: Delay Control Register */
#define FD_DCR_FORCE_HI WBGEN2_GEN_MASK(8, 1)
/* definitions for register: Fine Range Register */
/* definitions for register: Pulse start time / offset (MSB TAI seconds) */
/* definitions for register: Pulse start time / offset (LSB TAI seconds) */
/* definitions for register: Pulse start time / offset (8 ns cycles) */
/* definitions for register: Pulse start time / offset (sub-cycle fine part) */
/* definitions for register: Pulse end time / offset (MSB TAI seconds) */
/* definitions for register: Pulse end time / offset (LSB TAI seconds) */
/* definitions for register: Pulse end time / offset (8 ns cycles) */
/* definitions for register: Pulse end time / offset (sub-cycle fine part) */
/* definitions for register: Pulse spacing (TAI seconds) */
/* definitions for register: Pulse spacing (8 ns cycles) */
/* definitions for register: Pulse spacing (sub-cycle fine part) */
/* definitions for register: Repeat Count Register */
/* definitions for field: Repeat Count in reg: Repeat Count Register */
#define FD_RCR_REP_CNT_MASK WBGEN2_GEN_MASK(0, 16)
#define FD_RCR_REP_CNT_SHIFT 0
#define FD_RCR_REP_CNT_W(value) WBGEN2_GEN_WRITE(value, 0, 16)
#define FD_RCR_REP_CNT_R(reg) WBGEN2_GEN_READ(reg, 0, 16)
/* definitions for field: Continuous Waveform Mode in reg: Repeat Count Register */
#define FD_RCR_CONT WBGEN2_GEN_MASK(16, 1)
/* [0x0]: REG Delay Control Register */
#define FD_REG_DCR 0x00000000
/* [0x4]: REG Fine Range Register */
#define FD_REG_FRR 0x00000004
/* [0x8]: REG Pulse start time / offset (MSB TAI seconds) */
#define FD_REG_U_STARTH 0x00000008
/* [0xc]: REG Pulse start time / offset (LSB TAI seconds) */
#define FD_REG_U_STARTL 0x0000000c
/* [0x10]: REG Pulse start time / offset (8 ns cycles) */
#define FD_REG_C_START 0x00000010
/* [0x14]: REG Pulse start time / offset (sub-cycle fine part) */
#define FD_REG_F_START 0x00000014
/* [0x18]: REG Pulse end time / offset (MSB TAI seconds) */
#define FD_REG_U_ENDH 0x00000018
/* [0x1c]: REG Pulse end time / offset (LSB TAI seconds) */
#define FD_REG_U_ENDL 0x0000001c
/* [0x20]: REG Pulse end time / offset (8 ns cycles) */
#define FD_REG_C_END 0x00000020
/* [0x24]: REG Pulse end time / offset (sub-cycle fine part) */
#define FD_REG_F_END 0x00000024
/* [0x28]: REG Pulse spacing (TAI seconds) */
#define FD_REG_U_DELTA 0x00000028
/* [0x2c]: REG Pulse spacing (8 ns cycles) */
#define FD_REG_C_DELTA 0x0000002c
/* [0x30]: REG Pulse spacing (sub-cycle fine part) */
#define FD_REG_F_DELTA 0x00000030
/* [0x34]: REG Repeat Count Register */
#define FD_REG_RCR 0x00000034
#endif
This diff is collapsed.
This diff is collapsed.
CC=/acc/sys/L865/cdk/gcc -m32
CXX=/acc/sys/L865/cdk/g++ -m32
CFLAGS = -I. -g -I../lib -I../include
CXXFLAGS = -I. -g
LDFLAGS = -L../lib -llist -lpthread
all: list-boot list-input-test list-output-test list-dbg
list-boot: list-boot.o $(OBJS)
${CXX} -o list-boot list-boot.o $(OBJS) -L. $(LDFLAGS)
list-dbg: list-dbg.o $(OBJS)
${CXX} -o list-dbg list-dbg.o $(OBJS) -L. $(LDFLAGS)
list-input-test: list-input-test.o $(OBJS)
${CXX} -o list-input-test list-input-test.o $(OBJS) -L. $(LDFLAGS)
list-output-test: list-output-test.o $(OBJS)
${CXX} -o list-output-test list-output-test.o $(OBJS) -L. $(LDFLAGS)
clean:
rm -f list-boot list-input-test list-output-test list-dbg
#include <stdio.h>
#include "list-lib.h"
void list_boot_node(struct list_node *dev);
main(int argc, char *argv[])
{
if(argc < 2)
{
printf("usage: %s <lun>\n", argv[0]);
return 0;
}
int lun = atoi(argv[1]);
struct list_node *dev = list_open_node_by_lun(lun);
sleep(20000);
return 0;
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment