qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Igor Mammedov" <imammedo@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH 03/27] hw/apic.c: rename bit functions to not conflict with bitops.h
Date: Wed, 24 Oct 2012 15:49:37 -0200	[thread overview]
Message-ID: <1351101001-14589-4-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1351101001-14589-1-git-send-email-ehabkost@redhat.com>

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v1 -> v2:
 - Coding style change: break too-long line
---
 hw/apic.c | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/hw/apic.c b/hw/apic.c
index 49f0015..1772f2c 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -51,7 +51,7 @@ static int ffs_bit(uint32_t value)
     return ctz32(value);
 }
 
-static inline void set_bit(uint32_t *tab, int index)
+static inline void apic_set_bit(uint32_t *tab, int index)
 {
     int i, mask;
     i = index >> 5;
@@ -59,7 +59,7 @@ static inline void set_bit(uint32_t *tab, int index)
     tab[i] |= mask;
 }
 
-static inline void reset_bit(uint32_t *tab, int index)
+static inline void apic_reset_bit(uint32_t *tab, int index)
 {
     int i, mask;
     i = index >> 5;
@@ -67,7 +67,7 @@ static inline void reset_bit(uint32_t *tab, int index)
     tab[i] &= ~mask;
 }
 
-static inline int get_bit(uint32_t *tab, int index)
+static inline int apic_get_bit(uint32_t *tab, int index)
 {
     int i, mask;
     i = index >> 5;
@@ -184,7 +184,7 @@ void apic_deliver_pic_intr(DeviceState *d, int level)
         case APIC_DM_FIXED:
             if (!(lvt & APIC_LVT_LEVEL_TRIGGER))
                 break;
-            reset_bit(s->irr, lvt & 0xff);
+            apic_reset_bit(s->irr, lvt & 0xff);
             /* fall through */
         case APIC_DM_EXTINT:
             cpu_reset_interrupt(s->cpu_env, CPU_INTERRUPT_HARD);
@@ -379,13 +379,13 @@ void apic_poll_irq(DeviceState *d)
 
 static void apic_set_irq(APICCommonState *s, int vector_num, int trigger_mode)
 {
-    apic_report_irq_delivered(!get_bit(s->irr, vector_num));
+    apic_report_irq_delivered(!apic_get_bit(s->irr, vector_num));
 
-    set_bit(s->irr, vector_num);
+    apic_set_bit(s->irr, vector_num);
     if (trigger_mode)
-        set_bit(s->tmr, vector_num);
+        apic_set_bit(s->tmr, vector_num);
     else
-        reset_bit(s->tmr, vector_num);
+        apic_reset_bit(s->tmr, vector_num);
     if (s->vapic_paddr) {
         apic_sync_vapic(s, SYNC_ISR_IRR_TO_VAPIC);
         /*
@@ -405,8 +405,9 @@ static void apic_eoi(APICCommonState *s)
     isrv = get_highest_priority_int(s->isr);
     if (isrv < 0)
         return;
-    reset_bit(s->isr, isrv);
-    if (!(s->spurious_vec & APIC_SV_DIRECTED_IO) && get_bit(s->tmr, isrv)) {
+    apic_reset_bit(s->isr, isrv);
+    if (!(s->spurious_vec & APIC_SV_DIRECTED_IO) &&
+            apic_get_bit(s->tmr, isrv)) {
         ioapic_eoi_broadcast(isrv);
     }
     apic_sync_vapic(s, SYNC_FROM_VAPIC | SYNC_TO_VAPIC);
@@ -445,7 +446,7 @@ static void apic_get_delivery_bitmask(uint32_t *deliver_bitmask,
             int idx = apic_find_dest(dest);
             memset(deliver_bitmask, 0x00, MAX_APIC_WORDS * sizeof(uint32_t));
             if (idx >= 0)
-                set_bit(deliver_bitmask, idx);
+                apic_set_bit(deliver_bitmask, idx);
         }
     } else {
         /* XXX: cluster mode */
@@ -455,11 +456,11 @@ static void apic_get_delivery_bitmask(uint32_t *deliver_bitmask,
             if (apic_iter) {
                 if (apic_iter->dest_mode == 0xf) {
                     if (dest & apic_iter->log_dest)
-                        set_bit(deliver_bitmask, i);
+                        apic_set_bit(deliver_bitmask, i);
                 } else if (apic_iter->dest_mode == 0x0) {
                     if ((dest & 0xf0) == (apic_iter->log_dest & 0xf0) &&
                         (dest & apic_iter->log_dest & 0x0f)) {
-                        set_bit(deliver_bitmask, i);
+                        apic_set_bit(deliver_bitmask, i);
                     }
                 }
             } else {
@@ -502,14 +503,14 @@ static void apic_deliver(DeviceState *d, uint8_t dest, uint8_t dest_mode,
         break;
     case 1:
         memset(deliver_bitmask, 0x00, sizeof(deliver_bitmask));
-        set_bit(deliver_bitmask, s->idx);
+        apic_set_bit(deliver_bitmask, s->idx);
         break;
     case 2:
         memset(deliver_bitmask, 0xff, sizeof(deliver_bitmask));
         break;
     case 3:
         memset(deliver_bitmask, 0xff, sizeof(deliver_bitmask));
-        reset_bit(deliver_bitmask, s->idx);
+        apic_reset_bit(deliver_bitmask, s->idx);
         break;
     }
 
@@ -566,8 +567,8 @@ int apic_get_interrupt(DeviceState *d)
         apic_sync_vapic(s, SYNC_TO_VAPIC);
         return s->spurious_vec & 0xff;
     }
-    reset_bit(s->irr, intno);
-    set_bit(s->isr, intno);
+    apic_reset_bit(s->irr, intno);
+    apic_set_bit(s->isr, intno);
     apic_sync_vapic(s, SYNC_TO_VAPIC);
 
     /* re-inject if there is still a pending PIC interrupt */
-- 
1.7.11.7

  parent reply	other threads:[~2012-10-24 17:48 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24 17:49 [Qemu-devel] Subject: [PATCH 00/27] Fix APIC-ID-based CPU topology, take 3 Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 01/27] move I/O-related definitions from qemu-common.h to a new header (qemu-stdio.h) Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 02/27] cpus.h: include qemu-stdio.h Eduardo Habkost
2012-10-24 17:49 ` Eduardo Habkost [this message]
2012-10-24 17:49 ` [Qemu-devel] [PATCH 04/27] target-i386: initialize APIC at CPU level Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 05/27] kvm: create kvm_arch_vcpu_id() function Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 06/27] target-i386: kvm: set vcpu_id to APIC ID instead of CPU index Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 07/27] pc: pc_init1(): always use rom_memory on pc_memory_init() call Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 08/27] pc: pc_init1(): remove MemoryRegion arguments Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 09/27] pc: pc_init1(): get QEMUMachineInitArgs argument Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 10/27] pc: create PCInitArgs struct Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 11/27] pc: add PC_DEFAULT_CPU_MODEL #define Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 12/27] pc: add PCInitArgs parameter to pc_cpus_init() Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 13/27] pc: pass PCInitArgs struct to pc_memory_init() Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 14/27] pc: use FWCfgState* instead of void* for fw_cfg data Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 15/27] pc: rename bochs_bios_init() to pc_bios_init() Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 16/27] pc: pass PCInitArgs struct " Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 17/27] xen_machine_pv: use cpu_init() instead of cpu_x86_init() Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 18/27] pc: isolate the code that create CPUs Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 19/27] cpu_x86_init: check for x86_cpu_realize() errors Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 20/27] target-i386: do not call x86_cpu_realize() on cpu_x86_init() Eduardo Habkost
2012-10-31 16:32   ` Igor Mammedov
2012-10-31 16:43     ` Andreas Färber
2012-10-31 17:10       ` Eduardo Habkost
2012-11-01 12:53       ` Igor Mammedov
2012-10-31 17:01     ` Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 21/27] fw_cfg: remove FW_CFG_MAX_CPUS from fw_cfg_init() Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 22/27] pc: set CPU APIC ID explicitly Eduardo Habkost
2012-11-01 14:04   ` Igor Mammedov
2012-11-01 14:30     ` Eduardo Habkost
2012-11-01 14:50       ` Igor Mammedov
2012-10-24 17:49 ` [Qemu-devel] [PATCH 23/27] pc: set fw_cfg data based on APIC ID calculation Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 24/27] tests: support target-specific unit tests Eduardo Habkost
2012-10-24 17:49 ` [Qemu-devel] [PATCH 25/27] target-i386: topology & APIC ID utility functions Eduardo Habkost
2012-10-24 17:50 ` [Qemu-devel] [PATCH 26/27] pc: create separate init function for pc-1.3 Eduardo Habkost
2012-10-24 18:12   ` Michael S. Tsirkin
2012-10-25 13:23     ` Eduardo Habkost
2012-10-24 17:50 ` [Qemu-devel] [PATCH 27/27] pc: generate APIC IDs according to CPU topology Eduardo Habkost
2012-11-01 14:46   ` Igor Mammedov
2012-11-01 15:16     ` Eduardo Habkost

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=1351101001-14589-4-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=afaerber@suse.de \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).