diff options
| author | Simon Rettberg | 2021-07-22 14:36:35 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2021-07-22 14:36:35 +0200 |
| commit | fc21afb08c7b827b3cd4a77618f36a7abdc13494 (patch) | |
| tree | f7909726a1d49cb834bfa9647621b29cb15caea4 /src/arch/x86/drivers | |
| parent | Merge branch 'master' into openslx (diff) | |
| parent | [cloud] Retry DHCP aggressively in AWS EC2 (diff) | |
| download | ipxe-fc21afb08c7b827b3cd4a77618f36a7abdc13494.tar.gz ipxe-fc21afb08c7b827b3cd4a77618f36a7abdc13494.tar.xz ipxe-fc21afb08c7b827b3cd4a77618f36a7abdc13494.zip | |
Merge branch 'master' into openslx
Diffstat (limited to 'src/arch/x86/drivers')
| -rw-r--r-- | src/arch/x86/drivers/net/undinet.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/arch/x86/drivers/net/undinet.c b/src/arch/x86/drivers/net/undinet.c index 9b7d6d849..43cb18bfe 100644 --- a/src/arch/x86/drivers/net/undinet.c +++ b/src/arch/x86/drivers/net/undinet.c @@ -104,6 +104,13 @@ static union u_PXENV_ANY __bss16 ( undinet_params ); SEGOFF16_t __bss16 ( undinet_entry_point ); #define undinet_entry_point __use_data16 ( undinet_entry_point ) +/* Read TSC in real mode only when profiling */ +#if PROFILING +#define RDTSC_IF_PROFILING "rdtsc\n\t" +#else +#define RDTSC_IF_PROFILING "" +#endif + /** IRQ profiler */ static struct profiler undinet_irq_profiler __profiler = { .name = "undinet.irq" }; @@ -288,14 +295,14 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function, */ profile_start ( &profiler->total ); __asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */ - "rdtsc\n\t" + RDTSC_IF_PROFILING "pushl %%eax\n\t" "pushw %%es\n\t" "pushw %%di\n\t" "pushw %%bx\n\t" "lcall *undinet_entry_point\n\t" "movw %%ax, %%bx\n\t" - "rdtsc\n\t" + RDTSC_IF_PROFILING "addw $6, %%sp\n\t" "popl %%edx\n\t" "popl %%ebp\n\t" /* gcc bug */ ) |
