2

I'm a newbie in kerel. In a linux kernel macro definition, I saw a line

li r10 trap

I would like to know the use of this 'trap' value. Thanks in advance

ebin
  • 175
  • 1
  • 1
  • 12

2 Answers2

1

li is load immediate, r10 is a register, and there should be a comma before trap which is going to a macro parameter... if you show the line above without the containing macro, that last insight's lost. Basically, it's putting one of the macro parameters into CPU register r10. Knowing that by itself is just about useless by the way - you ought to get a tutorial that walks you through things in some systematic way. E.g. see http://www.linuxchix.org/content/courses/kernel_hacking/lesson7

Tony Delroy
  • 102,968
  • 15
  • 177
  • 252
  • Actually, I have some theoretical tutorials but I need some thing to workout. Can you suggest a useful tutorial please?. – ebin May 29 '13 at 03:48
  • @Abin: I don't know anything about what you know, what you consider theoretical or practical, or what you're really trying to achieve, so I can't currently suggest any tutorial. Anyway, that would be better (and may have already been) asked as a separate question. – Tony Delroy May 29 '13 at 05:21
0

It means that the register will be used to generate an exception is necessary.

isaach1000
  • 1,819
  • 1
  • 13
  • 18