~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to lib/include/vm_basic_defs.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-07-30 12:56:49 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730125649-97sfj5li8axiseoo
Tags: 2009.07.22-179896-2
* Temporarily building without dumbnet, the recently uploaded
  new dumbnet upstream version broke down (Closes: #539006).
* Using more common name to store local debian additions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
267
267
#define VM_PAE_LARGE_2_SMALL_PAGES (BYTES_2_PAGES(VM_PAE_LARGE_PAGE_SIZE))
268
268
#endif
269
269
 
 
270
#ifndef NR_MPNS_PER_PAGE
 
271
#define NR_MPNS_PER_PAGE (PAGE_SIZE / sizeof(MPN))
 
272
#endif
 
273
 
270
274
/*
271
275
 * Word operations
272
276
 */
666
670
#endif
667
671
#endif // _WIN32
668
672
 
 
673
#ifdef HOSTED_LG_PG
 
674
#define hosted_lg_pg 1
 
675
#else
 
676
#define hosted_lg_pg 0
 
677
#endif
 
678
 
 
679
/*
 
680
 ***********************************************************************
 
681
 * STRUCT_OFFSET_CHECK --                                    */ /**
 
682
 *
 
683
 * \brief Check if the actual offsef of a member in a structure
 
684
 *        is what is expected
 
685
 *
 
686
 *
 
687
 * \param[in]  STRUCT       Structure the member is a part of.
 
688
 * \param[in]  MEMBER       Member to check the offset of.
 
689
 * \param[in]  OFFSET       Expected offset of MEMBER in STRUCTURE.
 
690
 * \param[in]  EXTRA        Additional bytes to be added to OFFSET to
 
691
 *                          compensate for extra info (eg. debug info)
 
692
 *
 
693
 ***********************************************************************
 
694
 */
 
695
#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, EXTRA) \
 
696
  ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + EXTRA))
 
697
 
 
698
/*
 
699
 ***********************************************************************
 
700
 * STRUCT_SIZE_CHECK --                                      */ /**
 
701
 *
 
702
 * \brief Check if the actual size of a structure is what is expected
 
703
 *
 
704
 *
 
705
 * \param[in]  STRUCT       Structure whose size is to be checked.
 
706
 * \param[in]  SIZE         Expected size of STRUCT.
 
707
 * \param[in]  EXTRA        Additional bytes to be added to SIZE to
 
708
 *                          compensate for extra info (eg. debug info)
 
709
 *
 
710
 ***********************************************************************
 
711
 */
 
712
#define STRUCT_SIZE_CHECK(STRUCT, SIZE, EXTRA) \
 
713
  ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + EXTRA))
 
714
 
669
715
#endif // ifndef _VM_BASIC_DEFS_H_