Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182275
b: refs/heads/master
c: f125be1
h: refs/heads/master
i:
  182273: dfbb430
  182271: f857544
v: v3
  • Loading branch information
Suravee Suthikulpanit authored and Robert Richter committed Feb 26, 2010
1 parent 648081b commit c2467f2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64683da6643e8c6c93f1f99548399b08c029fd13
refs/heads/master: f125be1469303f7b9324447f251d74a0da24952f
23 changes: 23 additions & 0 deletions trunk/arch/x86/oprofile/op_model_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,29 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
}
}

/*
* 16-bit Linear Feedback Shift Register (LFSR)
*
* 16 14 13 11
* Feedback polynomial = X + X + X + X + 1
*/
static unsigned int lfsr_random(void)
{
static unsigned int lfsr_value = 0xF00D;
unsigned int bit;

/* Compute next bit to shift in */
bit = ((lfsr_value >> 0) ^
(lfsr_value >> 2) ^
(lfsr_value >> 3) ^
(lfsr_value >> 5)) & 0x0001;

/* Advance to next register value */
lfsr_value = (lfsr_value >> 1) | (bit << 15);

return lfsr_value;
}

static inline void
op_amd_handle_ibs(struct pt_regs * const regs,
struct op_msrs const * const msrs)
Expand Down

0 comments on commit c2467f2

Please sign in to comment.