aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/lib
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/microblaze/lib')
-rw-r--r--firmware/microblaze/lib/Makefile.inc47
-rw-r--r--firmware/microblaze/lib/hal_io.h24
-rw-r--r--firmware/microblaze/lib/net/.gitignore2
-rw-r--r--firmware/microblaze/lib/net_common.c8
-rw-r--r--firmware/microblaze/lib/pic.c3
5 files changed, 13 insertions, 71 deletions
diff --git a/firmware/microblaze/lib/Makefile.inc b/firmware/microblaze/lib/Makefile.inc
deleted file mode 100644
index d99fc4d98..000000000
--- a/firmware/microblaze/lib/Makefile.inc
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright 2010 Ettus Research LLC
-#
-# Copyright 2007 Free Software Foundation, Inc.
-#
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-
-COMMON_SRCS = \
- $(top_srcdir)/lib/u2_init.c \
- $(top_srcdir)/lib/abort.c \
- $(top_srcdir)/lib/ad9510.c \
- $(top_srcdir)/lib/clocks.c \
- $(top_srcdir)/lib/eeprom.c \
- $(top_srcdir)/lib/eth_addrs.c \
- $(top_srcdir)/lib/eth_mac.c \
- $(top_srcdir)/lib/_exit.c \
- $(top_srcdir)/lib/exit.c \
- $(top_srcdir)/lib/hal_io.c \
- $(top_srcdir)/lib/hal_uart.c \
- $(top_srcdir)/lib/i2c.c \
- $(top_srcdir)/lib/mdelay.c \
- $(top_srcdir)/lib/memcpy_wa.c \
- $(top_srcdir)/lib/memset_wa.c \
- $(top_srcdir)/lib/nonstdio.c \
- $(top_srcdir)/lib/pic.c \
- $(top_srcdir)/lib/pkt_ctrl.c \
- $(top_srcdir)/lib/print_addrs.c \
- $(top_srcdir)/lib/print_rmon_regs.c \
- $(top_srcdir)/lib/print_buffer.c \
- $(top_srcdir)/lib/printf.c \
- $(top_srcdir)/lib/ihex.c \
- $(top_srcdir)/lib/spi.c \
- $(top_srcdir)/lib/net_common.c \
- $(top_srcdir)/lib/arp_cache.c \
- $(top_srcdir)/lib/banal.c
diff --git a/firmware/microblaze/lib/hal_io.h b/firmware/microblaze/lib/hal_io.h
index ff87a3494..574df7d3e 100644
--- a/firmware/microblaze/lib/hal_io.h
+++ b/firmware/microblaze/lib/hal_io.h
@@ -70,13 +70,7 @@ hal_set_timeout(int delta_ticks)
static inline int
hal_disable_ints(void)
{
- int result, t0;
-
- //asm volatile("mfs %0, rmsr \n\
-// andni %1, %0, 0x2 \n\
-// mts rmsr, %1"
-// : "=r" (result), "=r" (t0));
- return result;
+ return 0; /* NOP */
}
/*!
@@ -86,13 +80,7 @@ hal_disable_ints(void)
static inline int
hal_enable_ints(void)
{
- int result, t0;
-
-// asm volatile("mfs %0, rmsr \n\
-// ori %1, %0, 0x2 \n\
-// mts rmsr, %1"
-// : "=r" (result), "=r" (t0));
- return result;
+ return 0; /* NOP */
}
/*!
@@ -102,13 +90,7 @@ hal_enable_ints(void)
static inline void
hal_restore_ints(int prev_state)
{
- int t0, t1;
-// asm volatile("andi %0, %2, 0x2 \n\
-// mfs %1, rmsr \n\
-// andni %1, %1, 0x2 \n\
-// or %1, %1, %0 \n\
-// mts rmsr, %1"
-// : "=r" (t0), "=r"(t1) : "r" (prev_state));
+ /* NOP */
}
#endif /* INCLUDED_HAL_IO_H */
diff --git a/firmware/microblaze/lib/net/.gitignore b/firmware/microblaze/lib/net/.gitignore
deleted file mode 100644
index 282522db0..000000000
--- a/firmware/microblaze/lib/net/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/firmware/microblaze/lib/net_common.c b/firmware/microblaze/lib/net_common.c
index 947f41dae..a34ca615b 100644
--- a/firmware/microblaze/lib/net_common.c
+++ b/firmware/microblaze/lib/net_common.c
@@ -41,6 +41,9 @@ static const bool debug = false;
static const eth_mac_addr_t BCAST_MAC_ADDR = {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};
+//used in the top level application...
+struct socket_address fp_socket_src, fp_socket_dst;
+
// ------------------------------------------------------------------------
static eth_mac_addr_t _local_mac_addr;
@@ -265,6 +268,11 @@ handle_icmp_packet(struct ip_addr src, struct ip_addr dst,
if (icmp->code == ICMP_DUR_PORT){ // port unreachable
//handle destination port unreachable (the host ctrl+c'd the app):
+ //filter out non udp data response
+ struct ip_hdr *ip = (struct ip_hdr *)(((uint8_t*)icmp) + sizeof(struct icmp_echo_hdr));
+ struct udp_hdr *udp = (struct udp_hdr *)(((char *)ip) + IP_HLEN);
+ if (IPH_PROTO(ip) != IP_PROTO_UDP || udp->dest != fp_socket_dst.port) return;
+
//end async update packets per second
sr_tx_ctrl->cyc_per_up = 0;
diff --git a/firmware/microblaze/lib/pic.c b/firmware/microblaze/lib/pic.c
index 226da5f85..b8beda311 100644
--- a/firmware/microblaze/lib/pic.c
+++ b/firmware/microblaze/lib/pic.c
@@ -54,7 +54,8 @@ pic_init(void)
* system interrupt handler with the appropriate prologue and
* epilogue.
*/
-void pic_interrupt_handler() __attribute__ ((interrupt_handler));
+//FIXME zpu-gcc does not install interrupt_handler like this
+//void pic_interrupt_handler() __attribute__ ((interrupt_handler));
void pic_interrupt_handler()
{