sf_buf.h (e45db9b837dc530b86149374e2baeaa775061107) sf_buf.h (0543fa5398a5bc65eab8a7c76e713a37856c26e9)
1/*-
2 * Copyright (c) 2003 Alan L. Cox <alc@cs.rice.edu>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 20 unchanged lines hidden (view full) ---

29#ifndef _MACHINE_SF_BUF_H_
30#define _MACHINE_SF_BUF_H_
31
32#include <sys/queue.h>
33
34struct vm_page;
35
36struct sf_buf {
1/*-
2 * Copyright (c) 2003 Alan L. Cox <alc@cs.rice.edu>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 20 unchanged lines hidden (view full) ---

29#ifndef _MACHINE_SF_BUF_H_
30#define _MACHINE_SF_BUF_H_
31
32#include <sys/queue.h>
33
34struct vm_page;
35
36struct sf_buf {
37 SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */
37 LIST_ENTRY(sf_buf) list_entry; /* list of buffers */
38 struct vm_page *m; /* currently mapped page */
39 vm_offset_t kva; /* va of mapping */
38 struct vm_page *m; /* currently mapped page */
39 vm_offset_t kva; /* va of mapping */
40 int ref_count; /* usage of this mapping */
40};
41
42static __inline vm_offset_t
43sf_buf_kva(struct sf_buf *sf)
44{
45
46 return (sf->kva);
47}
48
49static __inline struct vm_page *
50sf_buf_page(struct sf_buf *sf)
51{
52
53 return (sf->m);
54}
55
56#endif /* !_MACHINE_SF_BUF_H_ */
41};
42
43static __inline vm_offset_t
44sf_buf_kva(struct sf_buf *sf)
45{
46
47 return (sf->kva);
48}
49
50static __inline struct vm_page *
51sf_buf_page(struct sf_buf *sf)
52{
53
54 return (sf->m);
55}
56
57#endif /* !_MACHINE_SF_BUF_H_ */