Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/misoc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b5048f6cf1fa
Choose a base ref
...
head repository: m-labs/misoc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f6639c18330b
Choose a head ref
  • 3 commits
  • 8 files changed
  • 1 contributor

Commits on Jul 26, 2015

  1. Add a stub pthread header.

    The header implements only the pthread rwlock interface, which
    never actually locks.
    
    This is necessary to build libunwind.
    whitequark committed Jul 26, 2015
    Copy the full SHA
    b2710e4 View commit details
  2. Add a stub getenv() implementation.

    This is not strictly necessary to build libunwind (it can
    be built with -DNDEBUG), but it will be handy while it is
    debugged.
    
    It can be removed afterwards.
    whitequark committed Jul 26, 2015
    Copy the full SHA
    24463a1 View commit details
  3. Add libunwind.

    whitequark committed Jul 26, 2015
    Copy the full SHA
    f6639c1 View commit details
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -10,3 +10,6 @@
[submodule "extcores/litepcie_phy_wrappers"]
path = extcores/litepcie_phy_wrappers
url = https://github.com/enjoy-digital/litepcie_phy_wrappers
[submodule "software/unwinder"]
path = software/unwinder
url = https://github.com/whitequark/libunwind
27 changes: 27 additions & 0 deletions software/include/base/pthread.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef __PTHREAD_H
#define __PTHREAD_H

typedef int pthread_rwlock_t;

#define PTHREAD_RWLOCK_INITIALIZER 0

#ifdef __cplusplus
extern "C" {
#endif

inline int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock)
{ return 0; }
inline int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock)
{ return 0; }
inline int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock)
{ return 0; }
inline int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock)
{ return 0; }
int pthread_rwlock_unlock(pthread_rwlock_t *rwlock)
{ return 0; }

#ifdef __cplusplus
}
#endif

#endif /* __PTHREAD_H */
2 changes: 1 addition & 1 deletion software/libbase/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MSCDIR=../..
include $(MSCDIR)/software/common.mak

OBJECTS=exception.o libc.o errno.o crc16.o crc32.o console.o system.o id.o uart.o time.o qsort.o strtod.o spiflash.o
OBJECTS=exception.o libc.o errno.o crc16.o crc32.o console.o environ.o system.o id.o uart.o time.o qsort.o strtod.o spiflash.o

all: crt0-$(CPU).o libbase.a libbase-nofloat.a

11 changes: 11 additions & 0 deletions software/libbase/environ.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <stdlib.h>
#include <string.h>

char *getenv(const char *varname) {
if(!strcmp(varname, "LIBUNWIND_PRINT_APIS") ||
!strcmp(varname, "LIBUNWIND_PRINT_UNWINDING")) {
return "1";
} else {
return NULL;
}
}
30 changes: 30 additions & 0 deletions software/libunwind/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
MSCDIR=../..
include $(MSCDIR)/software/common.mak

COMMONFLAGS+=-integrated-as \
-I. -I$(MSCDIR)/software/include/dyld/ -I$(MSCDIR)/software/unwinder/include/ \
-D__ELF__ -D__linux__

OBJECTS=UnwindRegistersSave.o UnwindRegistersRestore.o UnwindLevel1.o libunwind.o

all: libunwind.a

# pull in dependency info for *existing* .o files
-include $(OBJECTS:.o=.d)

libunwind.a: $(OBJECTS)
$(AR) crs libunwind.a $(OBJECTS)

%.o: $(MSCDIR)/software/unwinder/src/%.cpp
$(compilexx-dep)

%.o: $(MSCDIR)/software/unwinder/src/%.c
$(compile-dep)

%.o: $(MSCDIR)/software/unwinder/src/%.S
$(assemble)

.PHONY: clean

clean:
$(RM) $(OBJECTS) $(OBJECTS:.o=.ts) $(OBJECTS:.o=.d) libuwind.a .*~ *~
Empty file.
2 changes: 2 additions & 0 deletions software/libunwind/strings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This is some obsolete BSD crap that libunwind pulls in
// that's so old and useless it's not worth putting into libbase.
1 change: 1 addition & 0 deletions software/unwinder
Submodule unwinder added at 7ce966