/* * netsniff-ng - the packet sniffing beast * Copyright (C) 2012 Christoph Jaeger * Subject to the GPL, version 2. */ #ifndef PKT_BUFF_H #define PKT_BUFF_H #include "hash.h" #include "built_in.h" #include "proto.h" #include "xmalloc.h" struct pkt_buff { /* invariant: head <= data <= tail */ uint8_t *head; uint8_t *data; uint8_t *tail; struct protocol *dissector; uint32_t link_type; struct sockaddr_ll *sll; }; static inline struct pkt_buff *pkt_alloc(uint8_t *packet, unsigned int len) { struct pkt_buff *pkt = xmalloc(sizeof(*pkt)); pkt->head = packet; pkt->data = packet; pkt->tail = packet + len; pkt->dissector = NULL; return pkt; } static inline void pkt_free(struct pkt_buff *pkt) { xfree(pkt); } static inline unsigned int pkt_len(struct pkt_buff *pkt) { bug_on(!pkt || pkt->data > pkt->tail); return pkt->tail - pkt->data; } static inline uint8_t *pkt_pull(struct pkt_buff *pkt, unsigned int len) { uint8_t *data = NULL; bug_on(!pkt || pkt->head > pkt->data || pkt->data > pkt->tail); if (len <= pkt_len(pkt)) { data = pkt->data; pkt->data += len; } bug_on(!pkt || pkt->head > pkt->data || pkt->data > pkt->tail); return data; } static inline uint8_t *pkt_peek(struct pkt_buff *pkt) { bug_on(!pkt || pkt->head > pkt->data || pkt->data > pkt->tail); return pkt->data; } static inline unsigned int pkt_trim(struct pkt_buff *pkt, unsigned int len) { unsigned int ret = 0; bug_on(!pkt || pkt->head > pkt->data || pkt->data > pkt->tail); if (len <= pkt_len(pkt)) ret = len; pkt->tail -= ret; bug_on(!pkt || pkt->head > pkt->data || pkt->data > pkt->tail); return ret; } static inline uint8_t *pkt_pull_tail(struct pkt_buff *pkt, unsigned int len) { uint8_t *tail = NULL; bug_on(!pkt || pkt->head > pkt->data || pkt->data > pkt->tail); if (len <= pkt_len(pkt)) { tail = pkt->tail; pkt->tail -= len; } return tail; } static inline void pkt_set_dissector(struct pkt_buff *pkt, struct hash_table *table, unsigned int key) { bug_on(!pkt || !table); pkt->dissector = lookup_hash(key, table); while (pkt->dissector && key != pkt->dissector->key) pkt->dissector = pkt->dissector->next; } #endif /* PKT_BUFF_H */ tion/devicetree/booting-without-of.txt?h=nds-private-remove&id=f4000cd99750065d5177555c0a805c97174d1b9f'>commitdiff
path: root/Documentation/devicetree/booting-without-of.txt
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-13 16:39:21 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-13 16:39:21 -0800
commitf4000cd99750065d5177555c0a805c97174d1b9f (patch)
tree88ab9f09e8fe1e97f34553f7964ee4598e7a0bfc /Documentation/devicetree/booting-without-of.txt
parent2ec4584eb89b8933d1ee307f2fc9c42e745847d7 (diff)
parent75037120e62b58c536999eb23d70cfcb6d6c0bcc (diff)
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 updates from Catalin Marinas: - struct thread_info moved off-stack (also touching include/linux/thread_info.h and include/linux/restart_block.h) - cpus_have_cap() reworked to avoid __builtin_constant_p() for static key use (also touching drivers/irqchip/irq-gic-v3.c) - uprobes support (currently only for native 64-bit tasks) - Emulation of kernel Privileged Access Never (PAN) using TTBR0_EL1 switching to a reserved page table - CPU capacity information passing via DT or sysfs (used by the scheduler) - support for systems without FP/SIMD (IOW, kernel avoids touching these registers; there is no soft-float ABI, nor kernel emulation for AArch64 FP/SIMD) - handling of hardware watchpoint with unaligned addresses, varied lengths and offsets from base - use of the page table contiguous hint for kernel mappings - hugetlb fixes for sizes involving the contiguous hint - remove unnecessary I-cache invalidation in flush_cache_range() - CNTHCTL_EL2 access fix for CPUs with VHE support (ARMv8.1) - boot-time checks for writable+executable kernel mappings - simplify asm/opcodes.h and avoid including the 32-bit ARM counterpart and make the arm64 kernel headers self-consistent (Xen headers patch merged separately) - Workaround for broken .inst support in certain binutils versions * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (60 commits) arm64: Disable PAN on uaccess_enable() arm64: Work around broken .inst when defective gas is detected arm64: Add detection code for broken .inst support in binutils arm64: Remove reference to asm/opcodes.h arm64: Get rid of asm/opcodes.h arm64: smp: Prevent raw_smp_processor_id() recursion arm64: head.S: Fix CNTHCTL_EL2 access on VHE system arm64: Remove I-cache invalidation from flush_cache_range() arm64: Enable HIBERNATION in defconfig arm64: Enable CONFIG_ARM64_SW_TTBR0_PAN arm64: xen: Enable user access before a privcmd hvc call arm64: Handle faults caused by inadvertent user access with PAN enabled arm64: Disable TTBR0_EL1 during normal kernel execution arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1 arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro arm64: Factor out PAN enabling/disabling into separate uaccess_* macros arm64: Update the synchronous external abort fault description selftests: arm64: add test for unaligned/inexact watchpoint handling arm64: Allow hw watchpoint of length 3,5,6 and 7 arm64: hw_breakpoint: Handle inexact watchpoint addresses ...
Diffstat (limited to 'Documentation/devicetree/booting-without-of.txt')