Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # 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.
- #
- # Copyright (C) 2011 Luka Perkov <openwrt@lukaperkov.net>
- #
- # Usage: mips-openwrt-linux-objdump -EB -b binary -m mips:isa32r2 -D YOUR_IMAGE_DUMP | awk -f lantiq_ram_extract_magic.awk
- BEGIN {
- print "/* "
- print " * This program is free software; you can redistribute it and/or modify "
- print " * it under the terms of the GNU General Public License as published by "
- print " * the Free Software Foundation; either version 3 of the License, or "
- print " * (at your option) any later version. "
- print " * "
- print " * generated with lantiq_ram_extract_magic.awk "
- print " */ "
- print ""
- mc_dc_value=0
- mc_dc_number=0
- right_section=0
- }
- /t2,[0-9]+$/ {
- if (right_section) {
- split($4, tmp, ",")
- mc_dc_value=sprintf("%X", tmp[2])
- }
- }
- /t2,[0-9]+\(t1\)$/ {
- if (right_section) {
- split($4, tmp, ",")
- split(tmp[2], tmp, "(")
- mc_dc_number=tmp[1]/16
- }
- }
- {
- if (right_section) {
- print "#define MC_DC" mc_dc_number "_VALUE\t0x" mc_dc_value
- }
- if ($4 == "t1,t1,0x1000")
- right_section=1
- if ($4 == "t2,736(t1)")
- right_section=0
- }
- END {
- print ""
- }
Add Comment
Please, Sign In to add comment