Forum Discussion
Altera_Forum
Honored Contributor
20 years agoI made the following changes which compiled and tested ok, but haven't done any comparative performance measurements yet.
1.) Added the following code to: \altera\kits\nios2\components\altera_lwip\UCOSII\inc\lwipopts.h /* * Enable LightWeight Protection. * Refer \altera\kits\nios2\components\altera_lwip\UCOSII\src\downloads\lwip-1.1.0\src\include\lwip\sys.h * for changes to the SYS_ARCH_DECL_PROTECT(), SYS_ARCH_PROTECT() and * SYS_ARCH_UNPROTECT() macros. */# define SYS_LIGHTWEIGHT_PROT 1 2.) Made the following changes in: \altera\kits\nios2\components\altera_lwip\UCOSII\src\downloads\lwip-1.1.0\src\include\lwip\sys.h /** SYS_ARCH_DECL_PROTECT * declare a protection variable. This macro will default to defining a variable of * type sys_prot_t. If a particular port needs a different implementation, then * this macro may be defined in sys_arch.h. */ //#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev# define SYS_ARCH_DECL_PROTECT(lev) alt_irq_context lev /** SYS_ARCH_PROTECT * Perform a "fast" protect. This could be implemented by * disabling interrupts for an embedded system or by using a semaphore or * mutex. The implementation should allow calling SYS_ARCH_PROTECT when * already protected. The old protection level is returned in the variable * "lev". This macro will default to calling the sys_arch_protect() function * which should be implemented in sys_arch.c. If a particular port needs a * different implementation, then this macro may be defined in sys_arch.h */ //#define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect()# define SYS_ARCH_PROTECT(lev) lev = alt_irq_disable_all() /** SYS_ARCH_UNPROTECT * Perform a "fast" set of the protection level to "lev". This could be * implemented by setting the interrupt level to "lev" within the MACRO or by * using a semaphore or mutex. This macro will default to calling the * sys_arch_unprotect() function which should be implemented in * sys_arch.c. If a particular port needs a different implementation, then * this macro may be defined in sys_arch.h */ //#define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev)# define SYS_ARCH_UNPROTECT(lev) alt_irq_enable_all(lev) //sys_prot_t sys_arch_protect(void); //void sys_arch_unprotect(sys_prot_t pval); 3.) Added the following include to: \altera\kits\nios2\components\altera_lwip\UCOSII\src\downloads\lwip-1.1.0\src\core\pbuf.c \altera\kits\nios2\components\altera_lwip\UCOSII\src\downloads\lwip-1.1.0\src\core\memp.c # include "sys/alt_irq.h" Not sure about any of the other tuning options, haven't got that far yet. ciao