~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to arch/x86/kernel/ftrace.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
static atomic_t nmi_running = ATOMIC_INIT(0);
124
124
static int mod_code_status;             /* holds return value of text write */
125
125
static void *mod_code_ip;               /* holds the IP to write to */
126
 
static void *mod_code_newcode;          /* holds the text to write to the IP */
 
126
static const void *mod_code_newcode;    /* holds the text to write to the IP */
127
127
 
128
128
static unsigned nmi_wait_count;
129
129
static atomic_t nmi_update_count = ATOMIC_INIT(0);
225
225
}
226
226
 
227
227
static int
228
 
do_ftrace_mod_code(unsigned long ip, void *new_code)
 
228
do_ftrace_mod_code(unsigned long ip, const void *new_code)
229
229
{
230
230
        /*
231
231
         * On x86_64, kernel text mappings are mapped read-only with
260
260
        return mod_code_status;
261
261
}
262
262
 
263
 
static unsigned char *ftrace_nop_replace(void)
 
263
static const unsigned char *ftrace_nop_replace(void)
264
264
{
265
 
        return ideal_nop5;
 
265
        return ideal_nops[NOP_ATOMIC5];
266
266
}
267
267
 
268
268
static int
269
 
ftrace_modify_code(unsigned long ip, unsigned char *old_code,
270
 
                   unsigned char *new_code)
 
269
ftrace_modify_code(unsigned long ip, unsigned const char *old_code,
 
270
                   unsigned const char *new_code)
271
271
{
272
272
        unsigned char replaced[MCOUNT_INSN_SIZE];
273
273
 
301
301
int ftrace_make_nop(struct module *mod,
302
302
                    struct dyn_ftrace *rec, unsigned long addr)
303
303
{
304
 
        unsigned char *new, *old;
 
304
        unsigned const char *new, *old;
305
305
        unsigned long ip = rec->ip;
306
306
 
307
307
        old = ftrace_call_replace(ip, addr);
312
312
 
313
313
int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
314
314
{
315
 
        unsigned char *new, *old;
 
315
        unsigned const char *new, *old;
316
316
        unsigned long ip = rec->ip;
317
317
 
318
318
        old = ftrace_nop_replace();