mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "zhaoyilong" <registcn@gmail.com>
To: <linux-kernel@vger.kernel.org>
Subject: Opening DEBUG in compressed/head.S,then kernel crashed
Date: Sun, 13 Jan 2013 20:29:17 +0800	[thread overview]
Message-ID: <29967FDF21E24227AD4EC1DE00AC4044@VIU9IM6TKCWEEDX> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1749 bytes --]

    When I open the macro DEBUG in the front of  file 
arch/arm/boot/decompressed/head.S,the kernel runs and stops at"Uncompressing 
Linux... done, booting the kernel."
CONFIG_DEBUG_ICEDCC is closed by default, so I am sure  the code runs tothe 
following branch:
...........
...........
...........
.macro kputc,val
mov r0, \val
bl putc
.endm

.macro kphex,val,len
mov r0, \val
mov r1, #\len
bl phex
.endm

.macro debug_reloc_start
#ifdef DEBUG
kputc #'\n'
kphex r6, 8 /* processor id */
kputc #':'
kphex r7, 8 /* architecture id */
...........
...........
...........

Problem is happened in a context like this:

    I have a board use cpu S5PV210,and an ok kernel provide by the factory 
anda  kernel download from kernel.org which carshed after printing "starting
kernel..." to dnw.
    To debug this,I want to test the macro kputc provided in this file¡ª¡ª 
using ok kernel.
I add a line "kputc #'a' " after the tag ".text", then make error says 
"undefined reference to `putc' ",it seems that compiler cant find "putc" 
used in
the definition of macro ¡°kputc¡±.
    This is an ok kernel,so I cant say the serial port is not open¡ª¡ªcan 
this mean "putc" is defined already?.

So I open DEBUG hoping to see debugging info by kernel itself,but it stops 
at"Uncompressing Linux... done, booting the kernel."
Opening DEBUG will lead to the call of ¡°kputc #'\n' ¡± in the code above 
which will also call putc!

Here,my questions comes:

1¡¢Why the error "  undefined reference to `putc'  " disappeared?
2¡¢Why it stops at"Uncompressing Linux... done, booting the kernel."?
3¡¢Can this error ( undefined reference to `putc'  ) mean the serial port is 
not open? Where is it defined ?
Is it refer to the C function or just an assembly macro£¿ 



             reply	other threads:[~2013-01-13 12:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-13 12:29 zhaoyilong [this message]
2013-01-14 18:14 ` Domenico Andreoli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29967FDF21E24227AD4EC1DE00AC4044@VIU9IM6TKCWEEDX \
    --to=registcn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®