summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-08-25 09:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-08-25 09:12:35 +0000
commitc7fc24dc4420057f103afe8fc64524ebc25c5d37 (patch)
tree3682407a599b8f9f03fc096298134cafba1c9b2f /scripts
parent1d793fade8b063fde3cf275bf1a5c2d381292cd9 (diff)
o Merge with Linux 2.1.116.
o New Newport console code. o New G364 console code.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Configure4
-rw-r--r--scripts/Makefile2
-rw-r--r--scripts/header.tk2
-rw-r--r--scripts/ksymoops.cc86
-rw-r--r--scripts/lxdialog/Makefile7
-rw-r--r--scripts/lxdialog/menubox.c100
-rw-r--r--scripts/mkdep.c4
-rw-r--r--scripts/tkcond.c2
8 files changed, 156 insertions, 51 deletions
diff --git a/scripts/Configure b/scripts/Configure
index 3b05916e6..e65b3f73d 100644
--- a/scripts/Configure
+++ b/scripts/Configure
@@ -1,7 +1,7 @@
#! /bin/sh
#
-# This script is used to configure the linux kernel.
+# This script is used to configure the Linux kernel.
#
# It was inspired by the challenge in the original Configure script
# to ``do something better'', combined with the actual need to ``do
@@ -525,7 +525,7 @@ mv .tmpconfig .config
mv .tmpconfig.h include/linux/autoconf.h
echo
-echo "The linux kernel is now hopefully configured for your setup."
+echo "The Linux kernel should now be configured for your setup."
echo "Check the top-level Makefile for additional configuration,"
echo "and do a 'make dep ; make clean' if you want to be sure all"
echo "the files are correctly re-made"
diff --git a/scripts/Makefile b/scripts/Makefile
index eaf0db043..3db649d66 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -1,4 +1,3 @@
-HOSTCFLAGS:=$(HOSTCFLAGS) -g -Wall
HEADER=header.tk
TAIL=tail.tk
@@ -18,6 +17,7 @@ kconfig.tk: ${TOPDIR}/Makefile ${TOPDIR}/arch/${ARCH}/config.in \
cat ${HEADER} >> ./kconfig.tk
./tkparse < ../arch/${ARCH}/config.in >> kconfig.tk
echo "set defaults \"arch/${ARCH}/defconfig\"" >> kconfig.tk
+ echo "set ARCH \"${ARCH}\"" >> kconfig.tk
cat ${TAIL} >> kconfig.tk
chmod 755 kconfig.tk
diff --git a/scripts/header.tk b/scripts/header.tk
index 76b576097..028aede3d 100644
--- a/scripts/header.tk
+++ b/scripts/header.tk
@@ -431,7 +431,7 @@ proc wrapup {w } {
catch {destroy $w}
toplevel $w -class Dialog
message $w.m -width 400 -aspect 300 -text \
- "The linux kernel is now hopefully configured for your setup. Check the top-level Makefile for additional configuration, and do a 'make dep ; make clean' if you want to be sure all the files are correctly re-made." -relief raised
+ "The Linux kernel should now be configured for your setup. Check the top-level Makefile for additional configuration, and do a 'make dep ; make clean' if you want to be sure all the files are correctly re-made." -relief raised
label $w.bm -bitmap info
pack $w.bm $w.m -pady 10 -side top -padx 10
wm title $w "Kernel build instructions"
diff --git a/scripts/ksymoops.cc b/scripts/ksymoops.cc
index b0aa76c82..13fb4518d 100644
--- a/scripts/ksymoops.cc
+++ b/scripts/ksymoops.cc
@@ -26,6 +26,9 @@
// command-line argument, and redirect the oops-log into stdin. Out
// will come the EIP and call-trace in symbolic form.
+// Changed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+// adapted to Linux/m68k
+
//////////////////////////////////////////////////////////////////////////////
// BUGS:
@@ -39,8 +42,9 @@
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
+#include <a.out.h>
-inline int strnequ(char const* x, char const* y, size_t n) { return (::strncmp(x, y, n) == 0); }
+inline int strnequ(char const* x, char const* y, size_t n) { return (strncmp(x, y, n) == 0); }
const int code_size = 20;
@@ -149,32 +153,34 @@ NameList::decode(unsigned char* code, long eip_addr)
/* This is a hack to avoid using gcc. We create an object file by
concatenating objfile_head, the twenty bytes of code, and
objfile_tail. */
- unsigned char objfile_head[] = {
- 0x07, 0x01, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ static struct exec objfile_head = {
+ OMAGIC, code_size + 4, 0, 0, sizeof (struct nlist) * 3, 0, 0, 0
};
- unsigned char objfile_tail[] = {
- 0x00, 0x90, 0x90, 0x90,
- 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x25, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00,
- 'g', 'c', 'c', '2', '_', 'c', 'o', 'm',
- 'p', 'i', 'l', 'e', 'd', '.', '\0', '_',
- 'E', 'I', 'P', '\0', '\0', '\0', '\0', '\0',
- '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
- '\0', '\0', '\0', '\0', '\0', '\0'
+ static struct {
+ unsigned char tail[4];
+ struct nlist syms[3];
+ unsigned long strsize;
+ char strings[42];
+ } objfile_tail = {
+#ifdef i386
+ { 0x00, 0x90, 0x90, 0x90 },
+#endif
+#ifdef mc68000
+ { 0x00, 0x00, 0x00, 0x00 },
+#endif
+ { { (char *) 4, N_TEXT, 0, 0, 0 },
+ { (char *) 19, N_TEXT, 0, 0, 0 },
+ { (char *) 37, N_TEXT | N_EXT, 0, 0, 0 } },
+ 42,
+ "gcc2_compiled.\0___gnu_compiled_c\0_EIP\0"
};
char const* objdump_command = "objdump -d oops_decode.o";
char const* objfile_name = &objdump_command[11];
ofstream objfile_stream(objfile_name);
- objfile_stream.write(objfile_head, sizeof(objfile_head));
+ objfile_stream.write((char *) &objfile_head, sizeof(objfile_head));
objfile_stream.write(code, code_size);
- objfile_stream.write(objfile_tail, sizeof(objfile_tail));
+ objfile_stream.write((char *) &objfile_tail, sizeof(objfile_tail));
objfile_stream.close();
FILE* objdump_FILE = popen(objdump_command, "r");
@@ -197,8 +203,8 @@ NameList::decode(unsigned char* code, long eip_addr)
memset(newbuf, '\0', sizeof(newbuf));
ostrstream ost(newbuf, sizeof(newbuf));
ost.width(8);
- ost << offset;
- ost << " <_EIP+" << offset << ">: " << &buf[6] << ends;
+ ost << hex << offset;
+ ost << " <_EIP+" << hex << offset << ">: " << &buf[6] << ends;
strcpy(buf, newbuf);
}
if (!strnequ(&buf[9], "<_EIP", 5))
@@ -233,6 +239,7 @@ NameList::decode(unsigned char* code, long eip_addr)
bp++;
if (!isxdigit(*bp)) {
cout << bp_0;
+#ifdef i386
} else if (*bp_1 == 'j' || strnequ(bp_1, "call", 4)) { // a jump or call insn
long rel_addr = strtol(bp, 0, 16);
ksym = find(eip_addr + rel_addr);
@@ -241,6 +248,21 @@ NameList::decode(unsigned char* code, long eip_addr)
cout << bp_0 << *ksym << endl;
} else
cout << bp_0;
+#endif
+#ifdef mc68000
+ } else if ((bp_1[0] == 'b' && bp_1[4] == ' ' && strchr("swl", bp_1[3]))
+ || (bp_1[0] == 'd' && bp_1[1] == 'b')) {
+ // a branch or decr-and-branch insn
+ if (bp_1[0] == 'd') // skip register
+ while (*bp && *bp++ != ',');
+ long rel_addr = strtoul(bp, 0, 16);
+ ksym = find(eip_addr + rel_addr);
+ if (ksym) {
+ *bp++ = '\0';
+ cout << bp_0 << *ksym << endl;
+ } else
+ cout << bp_0;
+#endif
} else {
cout << bp_0;
}
@@ -308,6 +330,7 @@ main(int argc, char** argv)
if (cin.eof())
break;
cin.get(c); /* swallow newline */
+#ifdef i386
if (strstr(buffer, "EIP:") && names.valid()) {
oops_column = strstr(buffer, "EIP:");
if (sscanf(oops_column+13, "[<%x>]", &eip_addr) != 1) {
@@ -321,6 +344,22 @@ main(int argc, char** argv)
else
cout << ::hex << eip_addr << " cannot be resolved" << endl;
}
+#endif
+#ifdef mc68000
+ if (strstr(buffer, "PC:") && names.valid()) {
+ oops_column = strstr(buffer, "PC:");
+ if (sscanf(oops_column+4, "[<%x>]", &eip_addr) != 1) {
+ cout << "Cannot read pc address from PC: line. Is this a valid oops file?" << endl;
+ exit(1);
+ }
+ cout << ">>PC: ";
+ KSym* ksym = names.find(eip_addr);
+ if (ksym)
+ cout << *ksym << endl;
+ else
+ cout << ::hex << eip_addr << " cannot be resolved" << endl;
+ }
+#endif
else if (oops_column && strstr(oops_column, "[<") && names.valid()) {
unsigned long address;
while (strstr(oops_column, "[<")) {
@@ -356,6 +395,9 @@ main(int argc, char** argv)
++p;
if (sscanf(p, "%x", &c) != 1)
break;
+#ifdef mc68000
+ *cp++ = c >> 8;
+#endif
*cp++ = c;
while (*p && *p++ != ' ')
;
diff --git a/scripts/lxdialog/Makefile b/scripts/lxdialog/Makefile
index fc5ee7ffd..90e192a55 100644
--- a/scripts/lxdialog/Makefile
+++ b/scripts/lxdialog/Makefile
@@ -1,8 +1,7 @@
-CC = gcc
-CPP = gcc -E
-OPTIM = -O2 -Wall -fomit-frame-pointer
+CC = $(HOSTCC)
+CPP = $(HOSTCC) -E
-CFLAGS = $(OPTIM) -DLOCALE
+CFLAGS = $(HOSTCFLAGS) -DLOCALE
LDFLAGS = -s -L .
LDLIBS = -lncurses
diff --git a/scripts/lxdialog/menubox.c b/scripts/lxdialog/menubox.c
index ad4380870..5d5a6b46f 100644
--- a/scripts/lxdialog/menubox.c
+++ b/scripts/lxdialog/menubox.c
@@ -19,6 +19,37 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+/*
+ * Changes by Clifford Wolf (god@clifford.at)
+ *
+ * [ 1998-06-13 ]
+ *
+ * *) A bugfix for the Page-Down problem
+ *
+ * *) Formerly when I used Page Down and Page Up, the cursor would be set
+ * to the first position in the menu box. Now lxdialog is a bit
+ * smarter and works more like other menu systems (just have a look at
+ * it).
+ *
+ * *) Formerly if I selected something my scrolling would be broken because
+ * lxdialog is re-invoked by the Menuconfig shell script, can't
+ * remember the last scrolling position, and just sets it so that the
+ * cursor is at the bottom of the box. Now it writes the temporary file
+ * lxdialog.scrltmp which contains this information. The file is
+ * deleted by lxdialog if the user leaves a submenu or enters a new
+ * one, but it would be nice if Menuconfig could make another "rm -f"
+ * just to be sure. Just try it out - you will recognise a difference!
+ *
+ * [ 1998-06-14 ]
+ *
+ * *) Now lxdialog is crash-safe against broken "lxdialog.scrltmp" files
+ * and menus change their size on the fly.
+ *
+ * *) If for some reason the last scrolling position is not saved by
+ * lxdialog, it sets the scrolling so that the selected item is in the
+ * middle of the menu box, not at the bottom.
+ */
+
#include "dialog.h"
static int menu_width, item_x;
@@ -123,6 +154,7 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
int i, j, x, y, box_x, box_y;
int key = 0, button = 0, scroll = 0, choice = 0, first_item = 0, max_choice;
WINDOW *dialog, *menu;
+ FILE *f;
max_choice = MIN (menu_height, item_no);
@@ -178,9 +210,26 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
item_x = (menu_width - item_x) / 2;
- if (choice >= max_choice){
- scroll = first_item = choice - max_choice + 1;
- choice = max_choice-1;
+ /* get the scroll info from the temp file */
+ if ( (f=fopen("lxdialog.scrltmp","r")) != NULL ) {
+ if ( (fscanf(f,"%d\n",&scroll) == 1) && (scroll <= choice) &&
+ (scroll+max_choice > choice) && (scroll >= 0) &&
+ (scroll+max_choice <= item_no) ) {
+ first_item = scroll;
+ choice = choice - scroll;
+ fclose(f);
+ } else {
+ remove("lxdialog.scrltmp");
+ fclose(f);
+ f=NULL;
+ }
+ }
+ if ( (choice >= max_choice) || (f==NULL && choice >= max_choice/2) ) {
+ if (choice >= item_no-max_choice/2)
+ scroll = first_item = item_no-max_choice;
+ else
+ scroll = first_item = choice - max_choice/2;
+ choice = choice - scroll;
}
/* Print the menu */
@@ -262,26 +311,34 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
} else if (key == KEY_PPAGE) {
scrollok (menu, TRUE);
- for (i=0; (i < max_choice) && (scroll > 0); i++) {
- wscrl (menu, -1);
- scroll--;
- print_item (menu, items[scroll * 2 + 1], 0, FALSE,
- (items[scroll*2][0] != ':'));
+ for (i=0; (i < max_choice); i++) {
+ if (scroll > 0) {
+ wscrl (menu, -1);
+ scroll--;
+ print_item (menu, items[scroll * 2 + 1], 0, FALSE,
+ (items[scroll*2][0] != ':'));
+ } else {
+ if (choice > 0)
+ choice--;
+ }
}
scrollok (menu, FALSE);
- choice = 0;
} else if (key == KEY_NPAGE) {
- scrollok (menu, TRUE);
- for (i=0; (i < max_choice) && (scroll+max_choice < item_no); i++) {
- scroll(menu);
- scroll++;
- print_item (menu, items[(scroll+max_choice-1)*2+1],
- max_choice-1, FALSE,
- (items[(scroll+max_choice-1)*2][0] != ':'));
+ for (i=0; (i < max_choice); i++) {
+ if (scroll+max_choice < item_no) {
+ scrollok (menu, TRUE);
+ scroll(menu);
+ scrollok (menu, FALSE);
+ scroll++;
+ print_item (menu, items[(scroll+max_choice-1)*2+1],
+ max_choice-1, FALSE,
+ (items[(scroll+max_choice-1)*2][0] != ':'));
+ } else {
+ if (choice+1 < max_choice)
+ choice++;
+ }
}
- scrollok (menu, FALSE);
- choice = 0;
} else
choice = i;
@@ -313,6 +370,11 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
case 'y':
case 'n':
case 'm':
+ /* save scroll info */
+ if ( (f=fopen("lxdialog.scrltmp","w")) != NULL ) {
+ fprintf(f,"%d\n",scroll);
+ fclose(f);
+ }
delwin (dialog);
fprintf(stderr, "%s\n", items[(scroll + choice) * 2]);
switch (key) {
@@ -336,6 +398,7 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
else
fprintf(stderr, "%s\n", items[(scroll + choice) * 2]);
+ remove("lxdialog.scrltmp");
return button;
case 'e':
case 'x':
@@ -346,5 +409,6 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
}
delwin (dialog);
+ remove("lxdialog.scrltmp");
return -1; /* ESC pressed */
}
diff --git a/scripts/mkdep.c b/scripts/mkdep.c
index c08eafad7..d6e9a7262 100644
--- a/scripts/mkdep.c
+++ b/scripts/mkdep.c
@@ -120,7 +120,7 @@ void define_config(int convert, const char * name, int len)
/*
* Clear the set of configuration strings.
*/
-void clear_config( )
+void clear_config(void)
{
len_config = 0;
define_config(0, "", 0);
@@ -195,7 +195,7 @@ void use_config(const char * name, int len)
* Thus, there is one memory access per sizeof(unsigned long) characters.
*/
-#if defined(__alpha__) || defined(__i386__) || defined(__MIPSEL__)
+#if defined(__alpha__) || defined(__i386__) || defined(__MIPSEL__) || defined(__arm__)
#define LE_MACHINE
#endif
diff --git a/scripts/tkcond.c b/scripts/tkcond.c
index 58bb072ff..fc133295d 100644
--- a/scripts/tkcond.c
+++ b/scripts/tkcond.c
@@ -96,7 +96,7 @@ static void free_condition(struct condition * cnd)
* Walk all of the conditions, and look for choice values. Convert
* the tokens into something more digestible.
*/
-void fix_choice_cond()
+void fix_choice_cond(void)
{
struct condition * cond;
struct condition * cond2;