https://bitbucket.org/hudson/magic-lantern
Revision 71a2a7c464d0256e413eaeec5a844a51e9de20e2 authored by alex@thinkpad on 06 February 2018, 16:51:54 UTC, committed by alex@thinkpad on 06 February 2018, 16:51:54 UTC
todo:
- log the value read from the MMIO register (ideally without re-reading that register)
- once some access is made, re-enable the memory protection for the next instruction
  (currently it's only enabled at the next interrupt, which misses most of the action)
- works in QEMU, crashes on camera
1 parent f351bb6
Raw File
Tip revision: 71a2a7c464d0256e413eaeec5a844a51e9de20e2 authored by alex@thinkpad on 06 February 2018, 16:51:54 UTC
io_trace: able to trap a few accesses in the MMIO region
Tip revision: 71a2a7c
Makefile.filerules

#
# generate dependencies
#
COBJS := $(filter %.o, $(ML_OBJS-y))
DEPS  := $(COBJS:.o=.d)
-include $(DEPS)

all::

#
#
# file type rules
#
#
%.s: %.c
	$(call build,CC -S,$(CC) $(CFLAGS) -S -o $@ $<)
%.sym: %
	$(call build,SYMBOLS,$(READELF) -sW $< | $(GREP) GLOBAL | $(GREP) -v " UND " | $(GREP) -E 'FUNC|OBJECT|ABS|NOTYPE' | $(AWK) "{print \$$2 \" \" \$$8;}" | $(GREP) -v '^ ' | $(GREP) -v __config_ | $(GREP) -v -E ' _[a-zA-Z]' | sort > $@)
%.o: %.c
	$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
%.o: $(PLATFORM_DIR)/%.c
	$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
%.o: $(SRC_DIR)/%.c
	$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
%.i: %.c
	$(call build,CPP,$(CC) $(CFLAGS) -E -c -o $@ $<)
%: %.c
	$(call build,LD,$(CC) $(CFLAGS) -o $@ $<)
%.o: $(PLATFORM_DIR)/%.S
	$(call build,AS,$(CC) $(AFLAGS) -c -o $@ $<)
%.o: $(SRC_DIR)/%.S
	$(call build,AS,$(CC) $(AFLAGS) -c -o $@ $<)
autoexec.bin: autoexec $(XOR_CHK)
	$(call build,OBJCOPY,$(OBJCOPY) -O binary $< $@)
	$(call build,XOR_CHK,$(XOR_CHK) $@)
autoexec-fir.bin: autoexec-fir $(XOR_CHK)
	$(call build,OBJCOPY,$(OBJCOPY) -O binary $< $@)
	$(call build,XOR_CHK,$(XOR_CHK) $@)
%.bin: %
	$(call build,OBJCOPY,$(OBJCOPY) -O binary $< $@)
	$(call build,STAT,$(STAT_CMD) $@)
%.rsc: %
	$(call build,LD,$(LD) -r -b binary -o $@ $<)

%-stubs.S: %.map
	perl -ne > $@ < $< 'BEGIN { print "#define SYM(a,n) n=a; .global n;\n" } s/[\r\n]//g; s/^\s*0001:([0-9A-Fa-f]+)\s+([^\s]+)$$/SYM(0x\1,\2)\n/ and print;'

%.dis: %.bin
	$(OBJDUMP) \
		-b binary \
		-m arm \
		-D \
		$< \
	> $@
back to top