aboutsummaryrefslogtreecommitdiffstats
path: root/package/libpcap
Commit message (Expand)AuthorAgeFilesLines
* libpcap: fix typo in protocol api patchNicolas Thill2009-05-121-1/+1
* pcap: fix disabling bluetoothFelix Fietkau2009-04-261-0/+2
* pcap: update to version 1.0.0, add extension for changing the desired protoco...Felix Fietkau2009-04-2510-605/+464
* get rid of $Id$ - it has never helped us and it has broken too many patches ;)Felix Fietkau2009-04-171-1/+0
* reduce the binary size of libpcap based programs that don't use bpf parsingFelix Fietkau2008-12-192-1/+119
* use $(FPIC) in a few places where it mattersFelix Fietkau2008-08-061-0/+2
* Update libpcap to 0.9.8 (#3571)Florian Fainelli2008-07-076-37/+496
* remove uninstalldev templates (no longer necessary)Felix Fietkau2007-12-251-5/+0
* add $(STAGING_DIR) as argument to the InstallDev template and update packages...Felix Fietkau2007-09-281-6/+6
* move package description to a separate definition, remove it when DESCRIPTION...Nicolas Thill2007-09-071-3/+5
* refresh all package patches in the buildroot using quiltFelix Fietkau2007-06-044-15/+21
* fix typo in UnistallDevNicolas Thill2007-03-231-1/+1
* add file type autodetection for the unpack command and nuke PKG_CAT:= in lots...Felix Fietkau2007-03-161-1/+0
* add a default for PKG_BUILD_DIR and PKG_INSTALL_DIR (will use KERNEL_BUILD_DI...Felix Fietkau2007-03-161-3/+0
* various configure related cleanupsFelix Fietkau2007-02-251-34/+7
* replace lots of manual install commands with INSTALL_* variablesFelix Fietkau2006-11-231-1/+1
* add sitefiles similar to the ones from openembeddedFelix Fietkau2006-10-191-1/+0
* finally move buildroot-ng to trunkFelix Fietkau2016-03-205-0/+283
cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef _I386_PAGE_H
#define _I386_PAGE_H

#define BUG() do {					\
	printk("BUG at %s:%d\n", __FILE__, __LINE__);	\
	__asm__ __volatile__("ud2");			\
} while (0)

#define L1_PAGETABLE_SHIFT       12
#define L2_PAGETABLE_SHIFT       22

#define ENTRIES_PER_L1_PAGETABLE 1024
#define ENTRIES_PER_L2_PAGETABLE 1024

#define PAGE_SHIFT               L1_PAGETABLE_SHIFT
#define PAGE_SIZE	         (1UL << PAGE_SHIFT)
#define PAGE_MASK	         (~(PAGE_SIZE-1))

#define clear_page(_p)           memset((void *)(_p), 0, PAGE_SIZE)
#define copy_page(_t,_f)         memcpy((void *)(_t), (void *)(_f), PAGE_SIZE)

#ifndef __ASSEMBLY__
#include <xen/config.h>
typedef struct { unsigned long l1_lo; } l1_pgentry_t;
typedef struct { unsigned long l2_lo; } l2_pgentry_t;
typedef l1_pgentry_t *l1_pagetable_t;
typedef l2_pgentry_t *l2_pagetable_t;
typedef struct { unsigned long pt_lo; } pagetable_t;
#endif /* !__ASSEMBLY__ */

/* Strip type from a table entry. */
#define l1_pgentry_val(_x) ((_x).l1_lo)
#define l2_pgentry_val(_x) ((_x).l2_lo)
#define pagetable_val(_x)  ((_x).pt_lo)

/* Add type to a table entry. */
#define mk_l1_pgentry(_x)  ( (l1_pgentry_t) { (_x) } )
#define mk_l2_pgentry(_x)  ( (l2_pgentry_t) { (_x) } )
#define mk_pagetable(_x)   ( (pagetable_t) { (_x) } )

/* Turn a typed table entry into a page index. */
#define l1_pgentry_to_pagenr(_x) (l1_pgentry_val(_x) >> PAGE_SHIFT) 
#define l2_pgentry_to_pagenr(_x) (l2_pgentry_val(_x) >> PAGE_SHIFT)

/* Turn a typed table entry into a physical address. */
#define l1_pgentry_to_phys(_x) (l1_pgentry_val(_x) & PAGE_MASK)
#define l2_pgentry_to_phys(_x) (l2_pgentry_val(_x) & PAGE_MASK)

/* Dereference a typed level-2 entry to yield a typed level-1 table. */
#define l2_pgentry_to_l1(_x)     \
  ((l1_pgentry_t *)__va(l2_pgentry_val(_x) & PAGE_MASK))

/* Given a virtual address, get an entry offset into a page table. */
#define l1_table_offset(_a) \
  (((_a) >> L1_PAGETABLE_SHIFT) & (ENTRIES_PER_L1_PAGETABLE - 1))
#define l2_table_offset(_a) \
  ((_a) >> L2_PAGETABLE_SHIFT)

/* Hypervisor table entries use zero to sugnify 'empty'. */
#define l1_pgentry_empty(_x) (!l1_pgentry_val(_x))
#define l2_pgentry_empty(_x) (!l2_pgentry_val(_x))

#define __PAGE_OFFSET		(0xFC400000)
#define PAGE_OFFSET		((unsigned long)__PAGE_OFFSET)
#define __pa(x)			((unsigned long)(x)-PAGE_OFFSET)
#define __va(x)			((void *)((unsigned long)(x)+PAGE_OFFSET))
#define page_address(_p)        (__va(((_p) - frame_table) << PAGE_SHIFT))
#define virt_to_page(kaddr)	(frame_table + (__pa(kaddr) >> PAGE_SHIFT))
#define VALID_PAGE(page)	((page - frame_table) < max_mapnr)

/*
 * NB. We don't currently track I/O holes in the physical RAM space.
 * For now we guess that I/O devices will be mapped in the first 1MB
 * (e.g., VGA buffers) or beyond the end of physical RAM.
 */
#define pfn_is_ram(_pfn)        (((_pfn) > 0x100) && ((_pfn) < max_page))

/* High table entries are reserved by the hypervisor. */
#define DOMAIN_ENTRIES_PER_L2_PAGETABLE	    \
  (HYPERVISOR_VIRT_START >> L2_PAGETABLE_SHIFT)
#define HYPERVISOR_ENTRIES_PER_L2_PAGETABLE \
  (ENTRIES_PER_L2_PAGETABLE - DOMAIN_ENTRIES_PER_L2_PAGETABLE)

#ifndef __ASSEMBLY__
#include <asm/processor.h>
#include <asm/fixmap.h>
#include <asm/bitops.h>
#include <asm/flushtlb.h>

#define linear_pg_table ((l1_pgentry_t *)LINEAR_PT_VIRT_START)
#define linear_l2_table ((l2_pgentry_t *)(LINEAR_PT_VIRT_START+(LINEAR_PT_VIRT_START>>(L2_PAGETABLE_SHIFT-L1_PAGETABLE_SHIFT))))

#define va_to_l1mfn(_va) (l2_pgentry_val(linear_l2_table[_va>>L2_PAGETABLE_SHIFT]) >> PAGE_SHIFT)

extern l2_pgentry_t idle_pg_table[ENTRIES_PER_L2_PAGETABLE];
extern void paging_init(void);

#define __flush_tlb()                                    \
    do {                                                 \
        __asm__ __volatile__ (                           \
            "movl %%cr3, %%eax; movl %%eax, %%cr3"       \
            : : : "memory", "eax" );                     \
        tlb_clocktick();                                 \
    } while ( 0 )

/* Flush global pages as well. */

#define __pge_off()                                                     \
        do {                                                            \
                __asm__ __volatile__(                                   \
                        "movl %0, %%cr4;  # turn off PGE     "          \
                        :: "r" (mmu_cr4_features & ~X86_CR4_PGE));      \
        } while (0)

#define __pge_on()                                                      \
        do {                                                            \
                __asm__ __volatile__(                                   \
                        "movl %0, %%cr4;  # turn off PGE     "          \
                        :: "r" (mmu_cr4_features));                     \
        } while (0)


#define __flush_tlb_pge()						\
	do {								\
                __pge_off();                                            \
		__flush_tlb();						\
                __pge_on();                                             \
	} while (0)

#define __flush_tlb_one(__addr) \
__asm__ __volatile__("invlpg %0": :"m" (*(char *) (__addr)))

#endif /* !__ASSEMBLY__ */


#define _PAGE_PRESENT	0x001
#define _PAGE_RW	0x002
#define _PAGE_USER	0x004
#define _PAGE_PWT	0x008
#define _PAGE_PCD	0x010
#define _PAGE_ACCESSED	0x020
#define _PAGE_DIRTY	0x040
#define _PAGE_PAT       0x080
#define _PAGE_PSE	0x080
#define _PAGE_GLOBAL	0x100

#define __PAGE_HYPERVISOR \
	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
#define __PAGE_HYPERVISOR_NOCACHE \
	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_PCD | _PAGE_ACCESSED)
#define __PAGE_HYPERVISOR_RO \
	(_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED)

#define MAKE_GLOBAL(_x) ((_x) | _PAGE_GLOBAL)

#define PAGE_HYPERVISOR MAKE_GLOBAL(__PAGE_HYPERVISOR)
#define PAGE_HYPERVISOR_RO MAKE_GLOBAL(__PAGE_HYPERVISOR_RO)
#define PAGE_HYPERVISOR_NOCACHE MAKE_GLOBAL(__PAGE_HYPERVISOR_NOCACHE)

#define mk_l2_writeable(_p) \
    (*(_p) = mk_l2_pgentry(l2_pgentry_val(*(_p)) |  _PAGE_RW))
#define mk_l2_readonly(_p) \
    (*(_p) = mk_l2_pgentry(l2_pgentry_val(*(_p)) & ~_PAGE_RW))
#define mk_l1_writeable(_p) \
    (*(_p) = mk_l1_pgentry(l1_pgentry_val(*(_p)) |  _PAGE_RW))
#define mk_l1_readonly(_p) \
    (*(_p) = mk_l1_pgentry(l1_pgentry_val(*(_p)) & ~_PAGE_RW))


#ifndef __ASSEMBLY__
static __inline__ int get_order(unsigned long size)
{
    int order;
    
    size = (size-1) >> (PAGE_SHIFT-1);
    order = -1;
    do {
        size >>= 1;
        order++;
    } while (size);
    return order;
}
#endif

#endif /* _I386_PAGE_H */